Make NPC rotate smoothly towards something?

Hello, I am trying to achieve a smooth rotation for an NPC.

I am trying to rotate this brachiosaurus towards the tree so I can then activate the “eating” animation.

In order to achieve this I tried using this blueprint I had on my first-person character when triggering the death animation. A raptor walks towards the player, when the death animation triggers, this blueprint makes the player rotate smoothly towards the raptor.

So I copied and pasted the code here, the only thing I changed was “get player controller” to “get controller”. But this code doesn’t work. I tried using set actor rotation but that rotates the npc instantly from one frame to another. How can I achieve this? Any help would be appreciate it. Thank you.

Interp Speed 1000 is too high, try something way lower, like 1–10.

I’ve tried different numbers, including 1, the brachiosaurus doesn’t move

Do you call SetRotation on tick? Such interpolation nodes must be called on tick; if you call it only once with a high Interp Speed, it just jumps to the final rotation value, but with low values it must be called multiple times to have smooth rotation.

I’ve tried calling it once, and on tick, doesn’t work. There is something wrong in my code because it is simply not rotating.

Replace these nodes:

  • “Set Control Rotation” → “Set Actor Rotation”
  • “Get Control Rotation” → “Get Actor Rotation”

And remove the “Get Controller” node.

Example:

1 Like

Already tried it and it works but the problem is the brachiosaurus has a rotation animation in the blendspace, for some reason it doesn’t activate.