Skip to content
Snippets Groups Projects

Walk Movement Controller Rotation Dependency Fix

Merged Kris Tabea Helwig requested to merge fix/WalkMovementRotationDependency into dev/5.4
1 file
+ 5
2
Compare changes
  • Side-by-side
  • Inline
@@ -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);
}
Loading