- Home /
Question by
easilyBaffled · Dec 09, 2012 at 08:02 PM ·
animationaddclip
Added animation not Playing
So I have to models of the same bone structure with two different animations. One is running while the other has an idle animation, both work on their respective models. But when I add the Run to the idle model, it wont run. The really odd thing is that Unity see's it in the inspector, and it will claim that it is running but its not. Any ideas?
void Start () {
foreach(AnimationState state in runner.animation){
animation.AddClip(runner.animation[state.name].clip, state.name);
//print(state.name);
}
foreach(AnimationState state in animation){
print(state.name);
}
}
...
if(destinationDistance < .5f){ // To prevent shakin behavior when near destination
moveSpeed = 0;
animation.CrossFade("idle");
}
else if(destinationDistance > .5f){ // To Reset Speed to default
moveSpeed = 4;
animation.CrossFade("Run");
if(animation.IsPlaying("Run")){
print("I am lying");
}
}
Comment