I’m wanting to make a cpu player that will randomly move about when idle, chase the player when it gets close, and when it gets close enough to attack, strafe around the player to avoid attacks while avoiding tnt. I’m not sure how to go about doing this in blueprints. Everything I try just doesn’t look good. Especially when the cpu reaches the point that it’s trying to go to-there’s such an abrupt stop and I have no clue what to do about it. (I’ve tried setting the friction to 0, it’s not helping)
Unreal has a visual AI system you can use, it is much more powerful and clean to use than standard BPs:
- Getting Started with AI
- Blueprint MOBA Minion/Creep AI: The Basics (series)
- Making Game Ready AI (series)
Here’s a vid of my first attempt at AI, it is kinda fun to look at how it is thinking:
In reference to the problem you’re having with the AI abruptly stopping:
- You can create your own AI function for the
MoveTo
, where when it decides to stop moving, it first lowers the max walk/run speed for0.2
seconds until it hits0
. - Or you can base the walk speed on the proximity to the target location, scale it down to
0.2
of regular speed when between 64-128 units, min-ing out at0.2
at 64 units of proximity.