Uploaded June 2018 | Updated September 2026, 27 minutes ago
I will show you how to create a Jumping System in Unity. The hardest part is to prevent a double jump or mid air jumps. We will prevent this by a grounded check. Have fun!
private void Jump()
{
var grounded = Physics.Raycast(transform.position + Vector3.up * 0.05f, Vector3.down, 0.1f);
Debug.DrawRay(transform.position + Vector3.up * 0.05f, Vector3.down, Color.red, 0.1f);
if (JumpButton.Pressed && grounded)
{
Rigidbody.velocity = new Vector3(Rigidbody.velocity.x, JumpForce, Rigidbody.velocity.z);
Actions.Jump();
}
}
I will show you how to create a Jumping System in Unity. The hardest part is to prevent a double jump or mid air jumps. We will prevent this by a grounded check. Have fun!
private void Jump()
{
var grounded = Physics.Raycast(transform.position + Vector3.up * 0.05f, Vector3.down, 0.1f);
Debug.DrawRay(transform.position + Vector3.up * 0.05f, Vector3.down, Color.red, 0.1f);
if (JumpButton.Pressed && grounded)
{
Rigidbody.velocity = new Vector3(Rigidbody.velocity.x, JumpForce, Rigidbody.velocity.z);
Actions.Jump();
}
}










