Creating a Ladder System in Unity — Part 2: Leaving the Ladder.

Now the player has to leave the ladder.

Rusben Guzman
2 min readApr 26, 2022

Objective: update the ladder system script to make the player able to leave the ladder.

For this example I added new animations, one for the climb ladder action and another for fall from the ladder.i In the animation controller these animations are triggered from any state and then go back to the idle state.

In the player script 2 other functions to set the values of the animators and flags when the player leaves the ladder and when is grounded.

In the ladder system script I created a conditional within the OnTriggerEnter function, if the player presses the up/down keys he is going to climb the ladder and if he presses the left/right key he falls from the ladder.

And that’s it!!! Now the player can leave the ladder at any moment.

--

--

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.