With the help of Lina I was able to get it working via a State machine.
Here is the setup :
When the player is climbing a ledge I will enter the state which for the moment looks like this :
- “Idle” is simply the idle animation when not moving along a ledge.
- “LedgeLeftStart” is my moving animation to the left, but NOT looping.
- “LedgeLeftLoop” is my moving animation to the left (the same one) but looping this time.
The condition to go from idle to LedgeLeftStart is just two boolean that I setup to know is the player is moving, and if he is moving to the left. If one of them is false, I got bakc to idle (hence the back and forth on the transitions o nthe graph).
The condition from LedgeLeftStart to LedgeLeftLoop is true if the animation from LedgeLeftStart has finished (and if the player is still moving), this means the first loop has been made and I can enter the loop state. The blending time between those two states is set to 0 as Lina mentioned. This way on the screen you have the feeling it’s the same animation that is looping. This is the most important part of the graph of course.
The result looks like this : Vine