How to smoothly rotate a character to target, without moving

i have two different characters id like to make rotate in a particular way.

one character needs to rotate and face its target before moving out towards it.

another character i need to approach the player and once in range continues to face the player but can only rotate so fast as to allow the player to get behind it for flanking damage.

i understand that disabling “Use Controller Rotation Yaw” in pawn and then changing the “Rotation Rate”>Yaw to some number helps with making smooth rotations, but that only helps if the characters are moving.

how to i get them to slowly and smoothly rotate to face an actor target with out doing a movement command??

Have you tried the RINTERP node?

Use a Find look at rotation which you can plug into the RInterp node mentions. You will want to set the Find Look at Rotation to the player location/rotation

crap, k new question thats totally relevant. i need to know when the character is looking directly at the player/target. so i did a if RinterpTo resulting rotator is equal to the input target variable (made from the FindLookAtRotation) then print “done” didnt work.

so i figured maybe theres some pitch or roll going on so i break both rotators and check if the yaw is equal between the two, still doesnt print “done”

is there a better way to compare rotators?

thanks guys, totally works.


Hi ClaverFlav,

Can you show me what you have so far? I might be able to see what is going on and come up with a viable solution.

Got it to work using both rotators yaws in a float Nearly Equal node with error tolerance of 2. anything lower didnt work.

now i need to find what way it is turning to determine what animation to play, turn left or turn right.

if i compare if the yaw of one is greater than the other ones yaw i assumed it was turning right which worked only on the first time it does it, after that it just starts playing the wrong anim for the rotation.

what the hell are rotators? degrees or radians or new values everytime??

Hi ClaverFlav,

Rotators work off of degrees. However, if you are using a relative rotation, it may be offsetting everything each time it is used.

Rotators are a combination of yaw, pitch, and roll rotations. Right click one in a blueprint and split it up to see!

I would like to know the solution to this as well!

So rickdlol I actually ended up using vectors instead for determining whether it was gonna turn left or right. So I would grab the characters forward vector, then the direction vector to the target, I had to flatten both by setting their a to 0, then normalized them and then I calculated the angle between the two vectors which I THINK is the cosine of the dot product of the two vectors. Then the result goes somewhere between 180 to -180 and I think negative was left.

Hope this helps.