Skip to content
Snippets Groups Projects
Commit 9ea93a8b authored by Kris Tabea Helwig's avatar Kris Tabea Helwig
Browse files

fix(movement): Fixes a bug where the movement velocity is dependent on the controller rotation

parent 77e27346
No related branches found
No related tags found
1 merge request!103Walk Movement Controller Rotation Dependency Fix
Pipeline #456754 passed
......@@ -41,8 +41,11 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
{
// you are only allowed to move horizontally in NAV_WALK
// everything else will be handled by stepping-up/gravity
// so remove Z component for the input vector of the UFloatingPawnMovement
InputVector.Z = 0.0f;
// so rotate the input vector onto horizontal plane
const FRotator InputRot = FRotator(InputVector.Rotation());
const FRotator InputYaw = FRotator(0, InputRot.Yaw, 0);
InputVector = InputRot.UnrotateVector(InputVector);
InputVector = InputYaw.RotateVector(InputVector);
ConsumeInputVector();
AddInputVector(InputVector);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment