How to interrupt Pursue once the player is no longer seen by AI

laurien

New member
Hi,

I'd like an AI to wander, and then pursue the player if the AI can see the player. While the AI is pursuing, if it can no longer see the player, I would like it to stop pursuing.

I'm wondering what the correct way would be to interrupt the Pursue once the player is no longer seen by the AI?

Screenshot 2022-09-28 160904.png

Thanks,
Laurien
 
You can use a Both conditional abort on the Sequence task for this situation.
 
Hi,

Thanks for your reply!

I've tried the both conditional abort but am unsure why I am seeing this behaviour (I've attached a video).

Firstly, Can See Object returns false while the player is moving, but still within view of the AI.

The main issue I'm unsure about is that after a while (at the end of the video), the Can See Object branch returns false and is no longer repeated. The Repeater is set to Repeat Forever & End On Failure to false.

Have I misunderstood how the repeater works?

 
Sorry! I've resolved both!

I'll leave my post up in case it helps anyone (as someone else's post ramblings helped me work it out!)

The flickering of the Can See Object was caused by the AI's collider.

I'd unticked the Instant check on the sequences, which was causing the issue with the Can See Object branch returning false. I'm a bit unsure why this happens though!
 
Top