Create a Ladder player can climb

Niraj Karki
3 min readAug 8, 2021

--

2.5D Game Development

Objective: allow player to climb the ladder

First of all create a ladder or import ladder asset to your project and place it at the position for the player to climb.

Then set the IsTrigger to true, add rigidbody and set gravity to false and finally add a Ladder script.

Also create an empty gameobject and place it so that we can move the player colliders to the ladder exit position after the animation is complete.

Now download the animation from the Mixamo.

Drag the downloaded animation file inside the project then set its rig animation type to Humanoid.

Also Bake position inside the animation

Now you can copy the Climbing to top animation and delete this file.

Now drag the copied animation into the player animator. There make the transition from Run->Climb to top, one way and Idle -> climb to top on both ways.

Then set the condition for bool value true for transition from both idle and run. Make sure to create a new parameter for this. Then keep the transition from climb to top -> Idle as empty/default.

Now add the behavior script to the climb to top animation.

Now create a new bool variable and set the condition as such so that player cannot move during ladder climb.

Create a public function which will start the animation and stop the player movement as well as store the position for collider to teleport to after animation is complete.

Now create another public function which teleports the collider to player location, set the animation to false and enable movement.

Now in the behaviour script, call the ladder exit function inside player when animation state is exited.

And this is the final result.

--

--

No responses yet