local containerGroup = {} local container for i = 1, 5 do container = display.newRect(i \* 75, 100, 50, 50) container.fill = \_WHITE\_ container:setStrokeColor(0, 0, 1) container.strokeWidth = 3 container = containerGroup[i] end containerGroup[i].x = centerX
I am trying to spawn a set of 5 rectangles to show the player their units and then move it to the center to avoid an issue that occurs on different devices. But when I try to set containers to be part of containerGroup table, I get the Attempt to index newField ?( A Nil Value ) error. Why does this occur?
Also, if anyone can, could they post some in-depth tutorials on tables in Corona? I feel like I still have a lot to learn about them. Thanks!