private void jump() { Debug.Log("isgrounded:" + isGrounded()); if (isGrounded()) { // Apply vertical force to simulate a jump rigidBody.AddForce(new Vector3(0, JumpForce, 0), ForceMode.Impulse); // Play jump sound SoundManagerScript.PlayJumpSound(); } }