Implementing Climb up animation in Unity
As per the last article, I’ve implemented grabbing a ledge. It’s now time to be able to climb up and stand on the platform. We need the climb up animation which we can get from mixamo.com:
Next, I need to import it to Unity.
We need to trigger Climbing Up with the E key on the Player.
Since we won’t use root position or let the animation dictate the position of the Player, we need to place a set position for the Player after the climbing up animation is complete.
Ledge_Grab is updated to be aware of the standing position:
It needs to be communicated to the Player where that Stand Position is. If the Player grabs the ledge, it should also get information on where to stand up.
As you can see above, Player Controller has to be disabled while moving the Player manually or else it will just fall off.
We will also use a trigger to transition from Hanging to Climbing Up.
However from Climbing Up, after the animation ends, it will automatically transition to Idle.
However, right before it reaches Idle, we need to Move the Player to the standing position. That can be done by adding a StateMachineBehavior on the Climbing Up animation which will be triggered during OnStateExit().
Now, the Player can climb up.