Smooth NPC head rotation

Hello. I made it so that when I enter the AI ​​Perception zone, the NPC turns his head towards me, but does it abruptly. I’m not that good at animation yet and I can’t make the NPC turn and turn away his head smoothly.


Here’s a tutorial :blush:

There is also a sharp turn there. We need to make it smooth somehow.

I’m not sure what do you mean by sharp turn, could you provide the timestamp when that happens in the tutorial?

When I enter the AI ​​perception zone, I suddenly turn my head.

This would not be the outcome if you followed the tutorial that I provided in my previous post, as you can see from the result at the end. Please follow the steps included there more carefully. Some stuff can be easy to miss when you’re comparing your implementation with the one in the tutorial, so I’d recommend doing it all over if you can’t figure it out that way. Do that, and if you still can’t figure it out, you can send all the parts related to your implementation.

Though the first thing I’d check would be that alpha value.

Figured it out, added it to delta x. But there is one small problem: if you put an animation where the bot initially turns its head on its own, then BP Look at in this case complements the head turn, and does not replace the original animation. Is it possible to make the head turn strictly according to BP Look At?


I didn’t quite get what you mean. But here are some things you can consider implementing:

  • If you want the head turning mechanic to only be executed on specific situations, you can use state machines and plug the same code into the out pose of the desired states instead of the main out pose of your anim graph. I also wanned to include a tutorial on state machines though don’t mind the leaning part in the tutorial and just focus on the state machines, here it is:
  • If you want the lower body to play another animation while the head turn is applied to the upper body, you can simply split the body. I originally explained how to do that but then thought just providing a tutorial would be better to make sure there are no mistakes in your implementation. Here it is:

Hope these help! :blush:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.