Smooth Character Rotation

I want to rotate an AI-controlled character to face it a certain location. The rotation should be smooth, not instantaneous, hence I don’t want to set the actor rotation directly. I know I could use a timeline or something like that, but that seems to be the wrong approach.

When that character moves via NavMesh, then it rotates smoothly towards the movement direction, which is fine. Now the same rotation speed should apply if the character is standing still and I command it to rotate.

But my question is: how do I command it to rotate in that case?

You need to use RInterpTo, here is the doc : RInterp To | Unreal Engine Documentation

It is really simple to use.

1 Like

MoveToLocation will move the actor to that location, if you set your actor to always be facing where he’s moving it will rotate with the movement.
SetControlRotation will rotate your Controller and only if the character uses the rotation of the PC it will rotate.
What I gave you was maybe not what you wanted, the RInterpTo will rotate your character to face a point (like tracking something that moves) it is similar to the MoveToLocation because you need a destination but it will not move, only rotate.

What do you mean by manual ?

PS : The BP I gave you, gives a result that needs to be used.

Good to know you found a solution :slight_smile:
Sorry I didn’t right away what you wanted.

Thanks for your answer. But I wonder, isn’t that again a manual approach? When using MoveToLocation via a Navmesh then the character is automatically rotating towards the movement vector in a smooth way, so apparently there is support for what I am looking for. I just need it also when the character is not moving, but solely rotating. Isn’t that what SetControlRotation is for? Unfortunately nothing happens when I use that BP node.

So with “manual” I mean that I need to call the RInterp node at every tick or something like that. However, I know the AI does already what I need, because it correctly rotates towards the movement position (when moving).

Now I want the same for rotation without movement: Give the AI a target point / actor and let it do its work, without me having to update the rotation at every tick.

I found the solution now: Simply call the SetFocus node and you’re set :slight_smile:

No worries, thanks for your feedback in any case :slight_smile: