Hi, I got a model in unity with 3 animations. I attached an image of what the model looks like. What i'm trying to do is quite obvious, but i'm having some trouble with crossfade looking good when i hit play. I'm assuming it's something to do with my script but i'm not entirely sure where it goes off the deep end. It doesn't appear to be doing the crossfading properly. Having read other posts, people suggest i call the CrossFade from the onUpdate function but how would that work with my buttons? Any insight would be welcome. Code (csharp): var logo : Texture2D; function OnGUI() { GUI.Label(Rect(0, 0, 65, 188), logo); GUI.Box(Rect(50,10,100,120), "Animatie Menu"); if(GUI.Button(Rect(20,40,80,20), "Animatie 1")) { if(animation.IsPlaying("animation2") || animation.IsPlaying("animation3") ) { animation.CrossFade("animation1"); } else { animation.Play("animation1"); } } if(GUI.Button(Rect(20,70,80,20), "Animatie 2")) { if(animation.IsPlaying("animation1") || animation.IsPlaying("animation3") ) { animation.CrossFade("animation2"); } else { animation.Play("animation2"); } } if(GUI.Button(Rect(20,100,80,20), "Animatie 3")) { if(animation.IsPlaying("animation1") || animation.IsPlaying("animation2") ) { animation.CrossFade("animation3"); } else { animation.Play("animation3"); } } } @script ExecuteInEditMode()
It looks like not all your animations have animation curves for all the bone rotations you are animating. Could that be the problem? Try to look in your program you used to make the animations and ensure that all the animatable rotations have animation curves in all the animations. Rune
I wonder if this has any bearing on my problem: http://forum.unity3d.com/viewtopic.php?p=159097 Can anyone confer?