[SOLVED] Create an object on multiple copies of another object

Hi, I tried to search for this, but I couldn’t find anything.

I’m creating a top-down game, where some enemies keeps firing bullets when the animation of them is finished.

If animation of “enemie” is finished → Create an object “bullet” at “enemie.X() enemie.Y()” and add a permanent force of 200 pixels.

This works fine if I place just one “enemie” on the map. However, if I copy this enemie, only one of them fires the bullet. In other words, the “bullet” is only being created in one of the enemies. I would like to know if there’s a way to create on every copy of this “enemie” object.

Thank you!

If you right click on the events editor, it’ll bring up an option “for each” - you might try using a “for each” condition in place of “if” condition.

Here’s a link to the wiki page For Each events [GDevelop wiki]

1 Like

Thanks! It worked perfectly!

1 Like