bounce pad

This commit is contained in:
2026-07-01 07:40:37 -05:00
parent 394422c500
commit e8dac480ec
@@ -436,10 +436,14 @@ public Vector3 GetVelocity()
/// <param name="bounciness">How bouncy the surface is</param> /// <param name="bounciness">How bouncy the surface is</param>
/// </summary> /// </summary>
public void Bounce(float bounciness) public void Bounce(float bounciness)
{
if (verticalVelocity < -3f)
{ {
float bounceForce = -verticalVelocity * bounciness; float bounceForce = -verticalVelocity * bounciness;
verticalVelocity = bounceForce;
moveDir.y = bounceForce; moveDir.y = bounceForce;
} }
}
#endregion #endregion
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
@@ -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);
} }
} }
} }