I restructure my question:
I spawn an Object multiple times and want that each of them act independently, meaning they shoot when they see me, and not if any of them see me, they have their own HP, which spawns on them and not on the first created of this object.
basically, what I need is a much more handy form of this:
After 10 Seconds Spawn Enemy1 with HP1 on top of them, if Enemy1 is in LineOfsight of Player1 (or Player2) shoot at them
After 10 Seconds Spawn Enemy2 with HP2 on top of them, if Enemy2 is in LineOfsight of Player1 (or Player2) shoot at them
After 10 Seconds Spawn Enemy3 with HP3 on top of them, if Enemy3 is in LineOfsight of Player1 (or Player2) shoot at them
After 10 Seconds Spawn Enemy4 with HP4 on top of them, if Enemy4 is in LineOfsight of Player1 (or Player2) shoot at them
.
.
.
After 10 Seconds Spawn EnemyN with HPN on top of them, if EnemyN is in LineOfsight of Player1 (or Player2) shoot at them
========================================================================================================
original text:
Hi guys,
first of all I dunno how I should'Ve put that into the topic title, so here it's a bit more in detail:
I spawn an enemy1 sprite all 10s and this enemy1 sprite should have an HP bar and a line of sight object. However, if I align the HPbar it always aligns to the first instance of enemy1. so all other enemies, spawned after him have no HP bar. Except if the enemy1 with the HP bar dies, then the HP bar spawns on top of the next Enemy1
Question: How can I get the HP bar to spawn on each Enemy1, when the Enemy1 spawns, stay there till as long as it has HP and then gets destroyed with the enemy1.
here are all related events and a gif to demonstrate my problem:
red=player1
Help would be much appreciated!
Thanks
genbatzu
//edit: bonusquestion: how can I get the player/enemies to "bump" from each other, if they collide?