I have a function that creates a number of objects. I want to reference these objects as a group (i.e. pick them all together) after they have been created, in the same tick. C2 seems to have an issue with this however, as for some reason, the objects don't seem to exist right after being spawned.
In the example code above (and the attached capx) you can see that it's a pretty straightforward function call which spawns a number of objects. After the call, their animation frames should be changed. However, they don't - the only instance which gets a frame change is one already in the layout before the function is called.
I'm not looking for a specific workaround for the above example, what I'm looking for is a way to pick all the objects that were spawned by the function in the same tick, and in the same event branch. for example, this works as intended:
But it's not a solution for me because (in my actual implementation) these events happen within another function:
For clarification: I'm not looking for a workaround to get this specific example working - I'm looking for a way to fix this within the constrants set (picking all the objects in the same tick, in the same event branch.)
I'm pretty sure the problem has to do with an issue I remember reading about, something about objects not being created until the next top-level event or something.
Is there any way to get around this?