Pausing and resuming animations Unity 5.2
Hey guys I got a problem that's been driving me crazy for days...
Ok so in my game i have a character that can walk left and right then when hes on a ladder an onLadder trigger is called and the player switches to the on ladder animation. problem is the animation plays even when the character is not moving on the ladder... I want the animation to pause on the frame that its currently at when movedirection.y is 0 and resume from where it was paused when movedirection.y >0.
At first I linked the animation.speed = movedirection.y but if animation.speed = 0 then it throws all these errors in unity 5.2.. so then i read i should use animation.enabled = false when movedirection.y = 0 and that does pause the animation in the correct spot but it will not resume the animation from that paused state when animation.enabled=true. it plays from the beginning of the animation not from the paused frame... Any suggestions its driving me nuts and it really should be simple...
Background info, using character controller and animator + scripts
Thanks in advanced :)