AI actor refuses to stop rotating toward Move Target

I’m reporting this as a bug because I can’t think what else it would be.

Create a basic Character actor, assign it an AI controller, have that AI controller run a Behavior Tree which instructs it to Move To an actor (say, the player pawn). Allow it to strafe or don’t, your choice. It doesn’t matter.

In the AI Character’s CharacterMovementComponent, set RotationRate to 0,0,0 (should prevent rotation, period), set “Orient Rotation to Movement” to false (should prevent rotation from being controlled by acceleration), and set “Use Controller Desired Rotation” to false (should prevent the AI controller from setting the rotation of the actor).

This should make it impossible for the AI Character you’ve just created to rotate AT ALL except directly via BP node.

Marvel as the AI, as soon as it begins to Move To the player actor, rotates to face him. If he tries to move when he’s facing the opposite direction of the player, marvel at his instantaneous rotation to the direction the player is in.

I’ve seen this problem reported before, and I’ve variously seen instruction to either disable Use Control Rotation and enable Orient to Movement, or vice versa. Neither one works. I was prepared to write up my own rotation-orienting script to handle this myself, but I can’t do it because the AI is constantly trying to override the rotation of the pawn ANY TIME it moves.

Surely there must be some way to disable this ugly-looking rotation behavior? Why is it that the AI is able to reach into the pawn and control his rotation even when the Character Controller should be forbidding it outright?

Hi RhythmScript,

Which version of the editor are you seeing this behavior in?

Version is 4.7 preview 3

Hi, I had the same exact problem myself. I was using:

GetCharacterMovement()->bOrientRotationToMovement = false;
GetCharacterMovement()->RotationRate = FRotator(0.f, 0.f, 0.f);
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->bSnapToPlaneAtStart = true;
GetCharacterMovement()->bIgnoreBaseRotation = true;

bUseControllerRotationPitch = false;
bUseControllerRotationRoll = false;
bUseControllerRotationYaw = false;

I kept adding these constraints and testing, and it kept rotating. However, I’m not sure you really need all of these because I ended up closing out of Unreal altogether and restarting it, and it worked. My problem could have been putting to much faith into Hot Compile to actually use my new code. Try restarting and see what happens!

This is happening in a purely Blueprint project though

Disabling ‘Use Controller Rotation Yaw’ doesn’t disable the rotation for you?

Mayhap I am a moron but I cannot find that option. I can find “Use Controller Desired Rotation”, but not “Use Controller Rotation Yaw”.

Hi RhythmScript,

I’m sorry about that, somehow I missed the notification that you posted.

Look in the Components panel and select the ‘YourBlueprintName’ (self) component. The ‘Use Controller Rotation Yaw’ is located in that.

Well, I’m not finding that particular component, just a generic inherited Pawn component, but… Doho! It’s not a CharacterMovementComponent setting, it’s a Pawn setting! Which explains why I couldn’t find it.

I’m still a little disappointed that RVO doesn’t report actual acceleration (meaning the pawns still don’t orient their rotation direction to their movement in that case) but I AM now able to control their rotation rate and prevent snapping to face the player. Thanks for your help!

I found in ai controller blueprint there is set control rotation from pawn orientation tick you can disable it for custom control rotation.