Skip to main content
‹ Back to Tutorials
Intermediate Unity

Unity Playmaker 2D Platformer - Climb Up and Down Ladder

Oct 17, 2021
About this tutorial

In this Unity Playmaker 2D Platformer - Climb Up and Down Ladder tutorial, I'll show how you can set up a climbing system using Playmaker. We will set up the ladder with a box collider 2D and a tag. Then take a look at the animation of the player climbing up and climbing down. Then I'll show sett

Written Guide

This Playmaker tutorial builds a 2D platformer ladder system that lets the player climb up and down without writing code. The approach hinges on detecting when the character is inside the ladder space, listening for the arrow keys while there, swapping in climb animations, and temporarily killing gravity so the player does not slide back down. Everything is driven by a single FSM with a few clear states.

Preparing the Ladder

The ladder already has a Box Collider 2D that is intentionally thin. Keeping it narrow forces the character to be centered on the ladder before climbing works, rather than triggering from the very edge. Set the collider to Is Trigger. Then add a new tag named ladder and apply it to the ladder object. On the player side, two simple animations are ready: climb up, with the head facing up and arms alternating, and climb down, the same motion with the head facing down.

Detecting the Ladder

Add a new FSM to the player and make the first state detect ladder. Use a Trigger 2D Event on the owner, set to On Trigger Enter, colliding with the tag ladder, sending a new event called key input. Because the player's Rigidbody has a Gravity Scale of 1, climbing would fight gravity, so in detect ladder a Set Gravity Scale action resets the scale to 1 for when the player leaves, the recovery side of the logic.

Listening for Keys and Cutting Gravity

The key input state watches for movement. A Get Key Down on the Up key sends move up, and another Get Key Down on the Down key sends move down. Here gravity is set to 0 so the climber does not get pulled down while on the ladder, and the animator speed is set to 0 so the climb pose holds still when not moving. A second Trigger 2D Event, this time On Trigger Exit with the ladder tag, sends a reset gravity event that returns to detect ladder, where gravity goes back to 1.

Moving Up and Down

In the move up state, a Translate Position 2D moves the character along the Y axis by a positive value of 1 for a slow climb, with Every Frame on, and the animator speed is set to 1. An Animator Play action plays the robot climb up state by name. A Get Key Up on the Up key sends a stop event back to key input so releasing the key halts movement and freezes the animation. The exit-detection Trigger 2D Event and reset gravity transition are copied in here too. The move down state mirrors all of this: copy the actions, point reset gravity back to detect ladder, set the Get Key Up to the Down arrow, change Animator Play to climb down, and flip the Translate Position 2D to a negative 1.

Testing and Polishing

On the first test the climb works but the idle pose stays frozen because animator speed was left at 0. The fix is to also set animator speed back to 1 in detect ladder. With that, the character climbs up and down smoothly, freezes when the key is released, resumes gravity on exit, and returns to its idle animation, a tidy reusable ladder system.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →