Platformer Make Enemy face Player only in Vision range

Hi, I’m just making a platformer game and I want the enemies to face the player only if the player is in the vision range of the enemy. But the enemies outside vision, or in another vision box(the purple tiled sprite) all face the player even though the player is not in their vision. How do I fix this? Please help.



I want only the archer in the photo to face the player, not the soldier and goblin, and if I go to goblin’s vision the goblin will face player and not archer and soldier. Thanks.

That Pick all instances of GroundMobs will pick all instances of GroundMobs in the scene. It ignores the collision with Vision condition.

Also, I’m not sure there a guarantee that the Vision the player collides with is the same as the Vision the GroundMobs collide with. You may need better identifiers to ensure it’s the same one.

And link an object, not a group of objects. Iterate over each object in the group to link it.

1 Like

Thanks, I removed pick all instances and it worked :smiley:

Hi can you take a look at this please Move enemy back and forth while player is not in vision

Please realise that an immediate response in these forums isn’t always possible. Many of us have work, family and other activities. Sometimes a response may not happen for a day or more.

1 Like