Character rotates towards move direction problem

I’m using the Top-down c++ template and the problem Im having is that my character rotates towards the move direction even though I have it turned off in the code:

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

	// Configure character movement
	GetCharacterMovement()->bOrientRotationToMovement = false;
	GetCharacterMovement()->RotationRate = FRotator(0.f, 0.f, 0.f);
	GetCharacterMovement()->bUseControllerDesiredRotation = false;
	GetCharacterMovement()->bIgnoreBaseRotation = true;
	GetCharacterMovement()->bConstrainToPlane = true;
	GetCharacterMovement()->bSnapToPlaneAtStart = true;

Am I missing something? Why is my character still rotating to the move direction?

If it’s the same as the fps template, It’s using a function that calculates the rotation with the movement. You’ll probably have to manually do it or you can just make setrotation 0.0f after the function.
You’re just wanting the character to move around without rotating right?

…I’m going to check it out

hmmm, it’s different from the fps template for sure

I got it to stop rotating at:

topdowncontroller.cpp

in the
SetNewMoveDestination class at the end

FRotator Rot(0.0f, 0.0f, 0.0f);
Pawn->SetActorRotation(Rot);

but rotates as soon as you let go of the mouse though…

ok got it:

in the TopDown Controller.cpp

in the PlayerTick function add code below at the end of it:

    FRotator Rot(0.0f, 0.0f, 0.0f);
    	GetWorld()->GetFirstPlayerController()->GetPawn()->SetActorRotation(Rot);

I couldn’t find another way too do it without ripping apart everything :confused:

You could use Rot to manually rotate the character if you need to.

You COULD add another mesh object to the character class and use ->babsoluteRotation = true on it and hide rotating character(and change it to a super simple mesh), it would work but that"s kind of a crazy hack lol.

This would work if it wouldn’t permanently kill rotation no matter what method was used. I only want to stop move direction changes from inflicting a new rotation on the character.

I think this may be a bug, but I found a fix. I had to go into my character BP, get character owner, connect to character movement, and set orient rotation to movement (uncheck).
Not sure why this doesn’t work in the code and only works in BP.