[Solved] A force after animation finished on multiple objects

hello!, I want to ask how to add force on multiple objects (in this case: menu_balls) after their animation is finished playing. I’ve tried actions and conditions like this (see the screenshot) but only the first ball that spawned has the force, the other balls that spawned don’t move because they don’t have the force. does anybody know how to make all the balls that spawned have the force?

note: menu_balls is a group of objects.

sorry for my bad english.

Have you tried using “pick all instances of (whatever object)”? That might work

how to do that?, :sweat_smile: I’ve tried searching for "pick all instances of ", but it seems that GDevelop doesn’t have such an event.

So I took a picture of the thing I was talking about. I had the name a little off but it’s basically the same thing. So if you go to all of your objects and click whatever you want to move you’ll get all of the options. Go down to the objects section and click pick all instances.
In my picture I don’t have everything you set up so just add “pick all instances” and hopefully it’ll work.

1 Like

1 Like

I’ve tried what you suggested, but I got the same result. I tried removing the “trigger once” condition and it kinda worked, but the force on the balls kept changing angles as they moved instead of one straight angle. so the problem is still not solved :frowning:

I guess removing the trigger once condition was a good idea. Inside the for each event it didn’t have what you expected.

Now your problem is that the only condition to give balls a new force is their animation is finished. So you need another condition that detect what ball already had its force given. Is there a condition to check if an object has a force? Or is moving? If not you can also tick an object variable, for example a boolean value to true when ball is created, and to false after the force is given. So the condition to give a force will be: if boolean value “forcenotgivenyet” is true, then add a force and turn the boolean to false"

1 Like

Thanks, it worked!. Instead of adding a variable, I changed the condition “trigger once” to “the overall speed of menu_balls < 1”

1 Like