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>
public void Bounce(float bounciness)
{
float bounceForce = -verticalVelocity * bounciness;
moveDir.y = bounceForce;
if (verticalVelocity < -3f)
{
float bounceForce = -verticalVelocity * bounciness;
verticalVelocity = bounceForce;
moveDir.y = bounceForce;
}
}
#endregion
@@ -473,7 +477,6 @@ private void OnControllerColliderHit(ControllerColliderHit hit)
if (bouncePad != null)
{
Bounce(bouncePad.bounciness);
Debug.Log("Bounce! " + verticalVelocity);
}
}
}