I’m trying to loop over some objects, and then for each object loop over a corresponding array in a Scene variable to create new objects. But the “For every child in…” event doesn’t seem to be working for me. I could use some pointers as to what I’m doing wrong. I’ve made a demo project showing the issue…
I have the following ‘placeholder’ objects in my scene, each with a ‘position’ variable set to ‘left’ and ‘right’ respectively:
The goal here is to display text objects showing the numbers 12, 18 & 36 on top of the ‘left’ placeholder object, and the numbers 5 & 101 on top of the ‘right’ placeholder object.
My text object has a default value (“Initial text to display”) of ‘0’, so even if setting the text based on the ‘child’ variable isn’t working properly, there should still be text objects with ‘0’ displayed:
I disabled the setting of the text but it’s still not showing any text objects at all. I also added the third parameter as you suggested and checked the debugger, but it shows both ‘child’ and ‘childName’ as number type variables:
I don’t think the for each child can read the object variable for the [structure name]. I set a scene variable to the value of the object variable and it worked. I don’t understand what you’re doing with the random. So, I just tested it with a variable for the X().