I’ve looked all over but can’t find a way to copy an array or structure variable into an object variable’s value.
For example, I have an array like this made up of 3 arrays, each with a set of 4 or more pairs of x,y coordinates:
AllCorners = [
[[0,0],[24,0],[24,24],[0,24]],
[[0,0],[24,0],[24,48],[0,48]],
[[0,0],[24,0],[72,24],[72,48],[48,72],[24,72],[0,48]]
]
As the game starts and creates objects, I want to iterate through the array and assign each child of the original to one of the objects.
something like:
Object1.corners = AllCorners[0]
Object2.corners = AllCorners[1]
Object3.corners = AllCorners[2]
and so on…
This way, Object1’s variable “corners” should contain: [[0,0],[24,0],[24,24],[0,24]] And then I should be able to iterate through that for other functions.
But anything I’ve tried to do just ends up with the “corners” value = 0.
I’ve used:
to convert the string into a global structure variable, but I don’t know where to go from there.
Any suggestions?