How to stop AI Character at a certain point?

Hi,
I made a blueprint enemy ship with a simple behaviour tree. I want the enemy to stop when it’s ‘x’ meters away from my player character. For that, I’m using a player key in the Blackboard which represents an abject (an Actor to be specific). So, my enemy is moving towards me, but how do I stop it? Acceptable radius is not working, and if I decide to move my enemy towards the location of the player (stored in the vector key) instead of the player itself, the enemy isn’t moving at all.

1 Like

I havn’t try flying characters, but a similar decorator like below should work in your case. You need to provide a boolean key to track if it is out of distance.

image

1 Like

Use the location vector over the object.
When you use the object key, the AI always goes to where the player is. It’s easier to use location as when the AI loses sight, they will just move to the last location vector.

1 Like