I have a setup where the character uses orient rotation to movement while his velocity is 0, and when he starts moving the mode switches to use controller desired rotation. I am using enhanced input. But, when I am looking at the front of my character and then start moving, instead of turning 180 degrees he does a weird pivot.
@jomskarlsefni
Are you looking for the effect of turning entirely in place, without moving the character forward at all?
I think your combination of the two controllers could be making this effect. I don’t know how else it would be happening.
I hope this can help!
-Zen
Hi Zen, yes I am looking for turning entirely in place. As shown in the video, the character turns around a point, not in place. Could you elaborate on what you mean by 2 controllers?
Thank you
if (Value.GetMagnitude() != 0.f)
{
//add movement in the direction
AddMovementInput(GetActorForwardVector(), Value[1]);
//add movement in the direction
AddMovementInput(GetActorRightVector(), Value[0]);
}
Is there a function for adding movement to the controller?
if (Value.GetMagnitude() != 0.f)
{
const FRotator ControllerRotation(0.0f, Controller->GetControlRotation().Yaw, 0.0f);
//add movement in the direction
const FVector ForwardDir = ControllerRotation.RotateVector(FVector::ForwardVector);
AddMovementInput(ForwardDir , Value[1]);
//add movement in the direction
const FVector RightDir = ControllerRotation.RotateVector(FVector::RightVector);
AddMovementInput(RightDir , Value[0]);
}