I cannot jump in my game

I was watching this video by by Brackeys on how to add first person player movement to my game and tried to implement jumping into it as shown in the video but it didn’t really work out. Does anyone know how to fix this? :

7627615–949090–PlayerMovement.cs (1.16 KB)

Have you created a Ground layer and assigned your ground GameObjects to that layer? And have you selected that in PlayerMovement inspector?

Thanks! I assigned the ground layer and now it works!

1 Like

Just a heads up, I love Brackeys, but this method is TERRIBLE.

It has an input delay, and the controller is not subject to forces without some finagling.

If you want things like rocket jumps you’ll want to make a custom controller.

I’m having a lot of success with creating a rigidbody and multiple colliders to make a physics based controller that also respect slopes and steps.

Basically I shoot a ray straight down and tell the player to mark itself as grounded, then move the player up about a meter, and to go into “slide” mode when the normal of the floor is too steep.

This allows the player to walk up any steps smaller than a meter without any issues.

You will never get stuck, it is so stupid simple to build levels for, and it’s fairly low hit on performance.

Also, make sure to give the movement collider zero friction and lock all rotations.

1 Like