fix: modifications to direction handling for when move stick is pressed lightly
This commit is contained in:
@@ -64,8 +64,8 @@ namespace Reset.Units{
|
||||
targetDirection = (Camera.main.transform.rotation * targetDirection.ToVector3()).ToVector2();
|
||||
|
||||
// Deadzone
|
||||
if (targetDirection.magnitude < .08f) {
|
||||
targetDirection = Vector2.zero;
|
||||
if (targetDirection.magnitude < .1f) {
|
||||
targetDirection = resolvedMovement.moveDirection.RawWorld;
|
||||
}
|
||||
|
||||
// Set Raw Direction (this is used by the camera later)
|
||||
@@ -94,7 +94,9 @@ namespace Reset.Units{
|
||||
newDirection = Vector2.Lerp(slerpedValue, lerpedValue, directionChangeDotLerp);
|
||||
} else {
|
||||
newDirection = Vector2.SmoothDamp(currentDirection, targetDirection, ref refVelocityDirectionChangingHardness, data.directionChangingSoftness.Value * data.airDirectionDecay.Value * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
newDirection = Vector3.Slerp(resolvedMovement.moveDirection.World, newDirection, controls.rawMoveInput.magnitude);
|
||||
|
||||
// Commit the new direction
|
||||
resolvedMovement.moveDirection.World = newDirection;
|
||||
|
||||
Reference in New Issue
Block a user