command concatenation

This is just an example for 2 objects, in my code is many more, what I need is to get position of an object and assign it to a new spawned object

object01.x = 400 object02.x = 600 num = math.random(1,2) spawnObject.x = "object0" .. num["x"] -- I need to get x position value from object01 or object02 but this does not work

You will have to do this as an array/table:

object[1].x =400

object[2].x = 600

spawObject.x = objects[num].x

Rob

You will have to do this as an array/table:

object[1].x =400

object[2].x = 600

spawObject.x = objects[num].x

Rob