Hi,
I did some digging and couldn't find a clear solution to this, so I'm asking for help:)
In short, I want the enemies to behave differently (change animation, speed, attack pattern,etc.) when the player is at different range. I used the Line of Sight behavior for the enemy family and did something like this:
for each enemy
-enemy has LOS to player
--abs(player.X-enemy.X)>350 -------events
--else
---abs(player.X-enemy.X)<150 --------events
---else --------events
(and something else about enemy movement, but since it worked there's no need to put it here)
However, when there are multiple instances from the enemy family, the player has to be within every instance's range for them to behave correctly. For example, if I want the enemy to play attack animation when abs(player.X-enemy.X)<150, every enemy instance has to be this close from player for them to play the animation together.
And that's obviously not the plan. Could someone explain to me why this happened? Hope I described the situation clear enough. Thanks!