How to make an AI follow the player and kill them when the AI gets too close

How to make an AI follow the player and kill them when the AI gets too close???

hey i have an enemy and i want them to follow the player and kill the player if they are too close.
i have a enemy made and an animation for him but i want to also know how to play his walking animation when hes following the player.

so i wish to know how to make an enemy follow and then kill the player.
thank you for your responses i do not know very much in unreal 4 so please be specific! thank you!

Hey, the animation of running should be done in the animation blueprint. I guess you would use the current walk speed for it.

To let an AI follow your Player, you would need to get all Actors of Class (Your Character) inside the Behavior Tree of your AI. Than you should check every tick if the distance between the player and the ai is at a specific range and than set the current location of the player to the variable that the MoveTo Node of the Behavior Tree is using.

I won’t explain everything in detail.

You can watch this series here to get an idea how it works.

He is making nearly the same, but with range attacks, like a gun, but i guess you should be able to change it to work for your game.

Thank you :smiley: