How do I bind instances of one type to others?

Hi!
How do I bind instances of one type to others? For example: there are 4 instances of enemies of the same type, 4 health bars of the same type. How do I link each health bar to my enemy ?So that each enemy has its own lane
image

Use Link to
When you create the health_bar use Link to Enemy, that way when you move the enemy and health_bar add Take into account Linked objects

health_bar is already placed on the stage, I’m not creating it

So you place 4 enemies and 4 health_bar in the level?
Is a good practice to use events to create enemies dynamically.

For instance:

Repeat 4 times
Action:
Create enemy at x, y
Create health_bar at enemy.X(), enemie.Y()
Link health_bar to enemy

Then to reference all together
Foreach enemy
Action:
Change health_bar position to enemy.X(), enemy.Y()-10
Take into account linked

Of course this is pseudo you need to look at GD for the names of the actions.

??? Not if you want them at predetermined positions in the scene.


Remove the Health bars from the scene, and add them in the events, pretty much as @UlisesFreitas suggested, but without the create enemy at x,y. Use a Repeat for all [object type] event.