Code: Select all
Cube = { Square = { x = {}, y = {}, Length = 30, Height = 10 } }
I tried just assigning stuff to Cube.Square[1].x[1] but I get errors. Do I have to do something special because Square has stuff inside it?
Code: Select all
Cube = { Square = { x = {}, y = {}, Length = 30, Height = 10 } }
Code: Select all
Cube.Square[1] = Cube.Square.x -- [1] and x will point to the same table.
Code: Select all
Cube = { Square = {{ x = {}, y = {}, Length = 30, Height = 10 }} }
Code: Select all
Cube = { Square = { {}, {}, {} } }
for i = 1, 3 do
Cube.Square[i].x = {}
Cube.Square[i].y = {}
end
Code: Select all
sq1 = {x1, y1, width1, height1}
sq2 = {x2, y2, width2, height2}
sq3 = {x3, y3, width3, height3}
Cube = { Square = { sq1, sq2, sq3 } }
Users browsing this forum: Google [Bot] and 5 guests