Как сделать так чтобы при прыжке он прыгал не бесконечно, а к примеру 1 раз в 3 секунды?
void Update() {
if(joystick.Vertical > 0.5 && isWallFront && !isGrounded)
{
if(transform.rotation.y == 0)
{
Jump();
}
soundeffector.PlayJumpSound();
}
else if (joystick.Vertical > 0.5 && isGrounded)
{
Jump();
}
}
public void Jump()
{
rb.velocity = Vector2.up * jumpHeight;//Прыжок
soundeffector.PlayJumpSound();
}