How to create a climbing physic like in donkey kong 64?

I would like to know how to make this physic when my player climb the tree , with my character position changing :

Sorry for not answering to your question, but I’m also very interested to know that as I could use the knowledge to create the same logic for my 2D game.

That tutorial might help you: