- Home /
Question by
qvatra · May 20, 2014 at 06:48 PM ·
animationanimatoranimator controlleranimationclipstate-machine
How to change speed of the specific state in animator
I have access to anim animator from my script. anim.speed functionality changes the speed of all states at the same time.
How to pick only one state from animator and change sped only for that state?
Comment
Answer by rednax20 · May 20, 2014 at 08:51 PM
i assume that you have various if statements, or things like that to activate each animation
even if it's not an if statement couldn't you just increase the speed whenever you play it, and slow it down, when your not? i don't see why you need to access one clip
or, heck you could just check and see if it's playing or not
just use Animation.isPlaying
if (anim.IsPlaying("fast animation")){
anim.speed = 2;
}else{
anim.speed = 1;
}
hope this helps