bounce pad

This commit is contained in:
2026-07-01 07:40:37 -05:00
parent 394422c500
commit e8dac480ec
@@ -437,8 +437,12 @@ public Vector3 GetVelocity()
/// </summary> /// </summary>
public void Bounce(float bounciness) public void Bounce(float bounciness)
{ {
float bounceForce = -verticalVelocity * bounciness; if (verticalVelocity < -3f)
moveDir.y = bounceForce; {
float bounceForce = -verticalVelocity * bounciness;
verticalVelocity = bounceForce;
moveDir.y = bounceForce;
}
} }
#endregion #endregion
@@ -473,7 +477,6 @@ private void OnControllerColliderHit(ControllerColliderHit hit)
if (bouncePad != null) if (bouncePad != null)
{ {
Bounce(bouncePad.bounciness); Bounce(bouncePad.bounciness);
Debug.Log("Bounce! " + verticalVelocity);
} }
} }
} }