How to make my enemy AI stop following player?

Depends on how you make him follow you, but jist check the distance between you and if it is above the limit then dont update? Or make him go to the position he is at.

good day guys,
I’m creating a stealth game and I’m having this enemy AI to follow my player (when it comes to sight of the AI, I used pawnSensing), I want at a certain range of sight (in future out of hearing range) that the AI stop chasing the player and go back to its routine.

Could you guys assist me with it?

Expanding on NoobsDeScroobs’ answer, you would add a blackboard FVector AggroPoint, AActor AggroActor, and float AggroDistance. You would create a selector with a decorator IsSet AggroActor and a task that falls to lower priority if it fails that checks the distance between itself and the AggroPoint. If the distance is greater the selector will fail (succeed), AggroActor will be unset (which is what causes the decorator to fail), and execution will go to lower priority (what’s on the right). There you can do all sorts of behavior like making the unit search the current area, wait for a certain period of time, or immediately return to AggroPoint and continue on its way.

Ill check that right away, I’m fairly new, thx dude

I’m fairly new, and I’m not familiar with the command. I’ll see how I can get to the point you mentioned. and post the update.
Thx dude

alright, I’ve got it settle, and here’s how I did it.

First, I made the behavior tree

It is important to note that I made it abort on both when the Blackboard “CanSeePlayer” is met,

I used the perception AI and made the blue print as below.

and also set the limitation of sight. But first you have to enable it, by adding sense config and having Ai sight config. Then open sense, there will be a drop box menu as below.

102795-enabling+senses.jpg

Setting up the AI behavior tree and the black board as well as the move to player blue print as below, you would surely made your AI to not follow player after it losses sight.

I found this video from Telsa Dev, and it teaches about AI behavior, if you would like to learn more , here’s the link Unreal Engine 4 Tutorial - AI Behaviour Tree - YouTube

thx guys, issue solved

thx guy, issue solved