Unity 3D Player movement works but Jump keybind does not

19 hours ago 2
ARTICLE AD BOX

The main issue is that you're mixing CharacterController and Rigidbody in the same script.

CharacterController doesn’t use Unity’s physics system, so calling AddForce on a Rigidbody won’t actually do anything here. That’s why your jump isn’t working.

Right now you also have two different jump methods:
- One using Rigidbody.AddForce()
- One using velocity with CharacterController

These don’t work together and can cause inconsistent behaviour.

Since you're already using CharacterController for movement, the easiest fix is to stick with that and remove the Rigidbody jump code:

if (Input.GetButtonDown("Jump")) { GetComponent<Rigidbody>().AddForce(Vector3.up * 5, ForceMode.VelocityChange); }

Then just keep your CharacterController jump logic:

if (Input.GetButtonDown("Jump") && isGrounded) { velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity); }

This way everything is handled consistently in one system.

Also, double check that your ground check is working properly, since jumping depends on isGrounded being true.

Read Entire Article