Put object around an other on multiple instances

Hey there,

In my game I am spawning enemies that have wings, but both the enemies and the wings are different objects. I need this so I can control the enemy animation independently form the wings flap.

I know how to put an object around an other using an empty condition and change position event, but I don’t know how to apply this for each instances of the “carrier object”. When I create new sets of enemy+wings, the wings all go to the first enemy created.

I am thinking of a scene variable that is picked up by the newly created enemy and then add 1 to the scene variable for the next enemy to pick up and also add one. But I don’t how how to target an object with a specific variable within an event.

Any help is appreciated!

Hi!

This condition targets the instance of Cadre whose ID variable number is the same as the one of a Group instance.
image

You can also use the Link actions to link the wings to the enemies when you create them, and then use the “take into account” conditions/actions to target certain instances.
Note that you may need to use a “For each” type of event in such cases.