Hey guys, I'm really stuck on my project. What I have is a 4 piece enemy. The enemy has a collision mask, a bottom sprite (legs if you will) and a top sprite (the head) and then a fire object that positions itself at the head. The reason why I went with this route is to let the top always look at the player and the fire object will also look in the same direction as the head. It's quite a simple enemy with 'Goomba" behavior. I also have made an enemy sight firing range that works when the player is overlapping it, the enemy will change animations and attack the player.

So my problem is whenever I want the enemy to attack the player, ever single enemy sees and attacks. I followed a neat little tutorial by the MeadowHare on youtube (ThatGuyOverThere) and he helped me get the movement foundation down.

I have tried many methods, but no matter what I do every enemy attacks. I have it to always my spread the value of its ID and then to start a loop to the number of its objects times (Not on the same condition)

I have it set up this way for the Attacking Group

>On loop "EnSinkMask"
ID of "SinkMask" = LoopIndex(EnSinkMask")
Player is overlapping Firing range
>> Start new loop "EnSinkAtck" 1 time (I only want him to attack once and then have a bit of a cool down)

> On loop "EnSinkAtck"
ID of "SinkMask" = LoopIndex(EnSinkMask")
>> Change animation sequence to Launching and look at the player,
Make both the head piece and fire invisible (The reason why, the legs have an animation for launching)

> On loop "EnSinkAtck"
ID of "SinkMask" = LoopIndex(EnSinkMask")
Animation Launching is over
>> Stop loop "EnSinkAtck"
Restore animation sequence of the bottom
Make both head and fire object visible again

I don't understand it, shouldn't the spread ID and equaling the ID of the enemy to the loop's index logically separate all enemies? I want only ONE to attack the player if the player is seen, not all of them x.x If anyone can help me, it would greatly be appreciated! (I am not using any extensions, all of this is custom engine).