For ladder climbing to work, three things play together:
Since ladders can be of different lengths, the animation for the character while he is on the ladder will be a looping animation.
Once the character has reached the upper end of the ladder, the code handling the climb will try to trigger an exit animation.
The animation for exiting the ladder will transport the character off of the ladder, so it needs to be in control of the character's movement.
The code will trigger the animation by setting the Signal Input to "exit_ladder_top".
In case something goes wrong with the animation or no ladder setup exists at all, the code will query whether the graph is still in one of the ladder states. If it is not, it will exit the ladder. This is also the reason why ladder climbing doesn't work if there is no AnimationGraph setup for it. The code uses the feedback from the graph also to determine when the exit ladder animation has finished.
To check whether the code is in a ladder state, the graph has to set an output which will be queried by the code.
The Ladder Climbing setup is now complete. You can save and reload your graph.