From the course: Advanced Unity 2D: Platformer Player Movement

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Cleaning up the wall jump

Cleaning up the wall jump - Unity Tutorial

From the course: Advanced Unity 2D: Platformer Player Movement

Start my 1-month free trial

Cleaning up the wall jump

- So as we saw in the previous video, we have the basic ability to jump off of the wall, but things are still a little bit buggy. One of the reasons for this is that we actually don't have a way of disabling the other scripts that are conflicting with the jumping off of the wall. In this case our walk script, our jump script, and our sliding down the wall script are all going to keep us from cleanly jumping away from the wall. So we're going to fix that by adding in a property into our wall jump that allows us to know when we're actually jumping off of the wall and, after a certain period of time, reset all the scripts that we disable. Let's open up our wall jump. Once inside we'll add a few public properties. Here I'm creating a public Boolean to keep track of whether we're jumping off of the wall or not. Then, I'm adding a public float, which represents our reset delay. And finally, I'm adding a private float that will represent the time elapsed since we attempted to jump off of the…

Contents