K
K
Koteron2017-06-06 07:45:16
Game development
Koteron, 2017-06-06 07:45:16

How to create a chasing enemy that only follows the player in its line of sight in Unity (2D)?

I created the enemy itself, that is, it pursues the player, but indefinitely. And I need him to pursue the player only in his line of sight. That is, when the player comes out of there, the enemy stops.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alexandrov, 2017-06-06
@Koteron

I assume that you have a banal pull-up along the coordinates behind the player. In this case, it's school geometry, you just need to ignore the player when he is outside the desired zone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question