How to pick all the instances of the object (Box1) which has the same animation activated and collision with this object ? (The object Box1 has 3 animations)
In the same event add these two conditions:
Box1 is in collision with TargetObject
Box1 current animation is TargetAnimation
You need to do it like this:
This will loop through all the instances of Box1 and picks the ones that have the collision and specified animation.
You can add the “For each object” event from the (+) button in top right side.
You don’t need, and shouldn’t use a “Repeat” clause here (for performance reasons)
GDevelop will “pick” against all objects on the first reference to one in an event, and then pick from the filtered list on each subsequent reference.
I didn’t know it works this way. Thanks for the advice!
I should revise my code then, since I always use the “Repeat” to target all instances of an object with certain conditions.