Day 16: Programming the wall jump

Philip Johnson
2 min readJul 9, 2021

Objective: to detect when we are touching a wall in order to wall jump off of the surface.

To accomplish this we need to detect when we are in the air and when we are touching a wall. Once we detect a wall we will use the Character Controller’s OnControllerColliderHit(ControllerColliderHit hit) method to find the direction to jump when we are touching a wall.

When we use the Character Controller component on the player we are provided with methods that help us manipulate the player’s movement and speed. To do achieve this we need to create a bool to help us control the wall jumping feature much better.

Then we will update the velocity of our player with the _wallSurfacenormal vector3 to provide a direction for the player to jump towards.

Now in the update loop of our player script we will manipulate the players jump ability.

the jump will no longer be controlled while in the air

With al of this in place we can now jump off of the surface of a wall so long as it tagged properly. The effect can be seen in action in the gif above.

--

--