I’m creating a randomly generated level system. Basically what I want is if a platform is of a specific type, it will create an object. What’s happening is it only creates one object, one for the last or second-to-last platform of that type. I want it to create an object for every platform of that type. Can someone help? Here is my code.
im not sure why this isnt working exactly, but for what you want, i think youd use the For each object event type (right click on create new event or press the plus in the top right) and then put that variable condition
Most conditions and actions reference and use all of the picked objects. Some only use 1 instance. For example, the create object action. It will only create 1 object. When an event needs the information from just one instance like the expression to get the position, it uses the properties from the old created object among the currently picked objects.
As mentioned, you can use for each object. That would repeat the events using each object. One at a time.
It’s best to filter the object list with a condition first before the for each object. So, it only repeats through the minimum number of objects.
Check object variable
… For each object
That way, if there are only 10 out of say 50 instances that have the object variable then it would only repeat 10 times instead of 50.
Make sure you have some form of trigger once. So, objects aren’t continously created. It could be anything from changing the variable, using a trigger once (before the for each object). You could also use a timer or check the number of objects in the scene or on or near a platform.
