Challenge: Implement Wall-Jumping.
Now that we have our elevator, we want to move on to our next section, which requires wall jumping. There are two things we want to do to set up; first we want to modify our player code to remove our ability to double jump:
and add in the following method to our player script:
which will show us the perpendicular direction of whatever object we are touching:
Now, we add the tag “Wall” to our walls, and modify our player code with the following in global:
Then we modify our player update method:
and collider hit method:
Which will allow us to wall jump.