How to repeat object linking to spawned objects (Solved)

I made 2 spawner (object) and gave them the spawner behavior, I added a condition that when the spawners spawns an object (skeleton) it will create an hp bar on that object.

On another event i made it that it checks if the object is linked with the hp bar and repositions it on top of the spawned object if it was linked. (this event is put on repeat for every instance of skeleton)

My problem is that it only creates the hp bar once, and only on one of the skeletons from either spawner. I noticed that it checks and creates the hp bar again when a skeleton was killed.

I need the hp bar to be created and linked repeatedly every time the spawner behavior works. Also I need the hp bar to be deleted when they die.

Screenshot of events:

updated events, i hope this helps people facing the same issue

had to swap the object being checked for link, it was skeleton > hp bar, now its hp bar > skeleton, also added separate conditions for the creation of hp bar and their linking.

1 Like

You could use the sticker behavior on the health bar object and stick the it to the enemy.

For testing, I used a textbox instead. I also used a timer instead of the spawn behavior.

I’m on my phone, so I just used the mouse released for testing.

2 Likes

Thanks I’ll try this one, it seems less tedious than what I did.

1 Like