Stay on Ladder

Hi,

I have a character and I wrote a script for him to climb up and down ladders, the only thing I’m stuck on is I want the character to be able to stay on the ladder, for example if the player took his finger off the up button while the character is still in the middle of the ladder, the character should not fall and stay there, but I don’t want to turn off the gravity because I want the player to be able to walk or jump off the ladder.

Help please?

I figured it out! it was pretty easy but somehow it didn’t occur to me right away.

I set the y velocity of the character to 0 in Update while OnLadder == true