- Home /
Why can't I get animations to play?
I made this character in Blender and exported it as a .FBX file. The animations didn't show up so I switched the rigging to humanoid and now I can see the animations in the inspector. When I try to put the model in the scene, the model doesn't play any animations. I added the animation component and selected the animations that the character can play. I even made this script to try and get the animations to play:
var animationToPlay : String;
function Update(){
animation.Play(animationToPlay);
}
I can't think of anything else that could be causing it not play. When I add that script, the console says that the animation can't be found.
do you try animation.CrossFade("anim",0.5)?
and what is your Wrap$$anonymous$$ode ?(loop,once,default or ping pong)
kyleyo9, make sure that the animation component attached has the animation that you want to play already in the drop-down list. I would also reccomend setting the type of animation to LEGACY. I think in 4, the default is the animator. If you have an ANI$$anonymous$$ATION component, and not an ANI$$anonymous$$ATOR component, and if the animation is in the drop down list, and you make sure that the name matches exactly (even case-sensitive i think) then I don't see why it shouldn't work unless some other component or script is controlling it.
Answer by TonyLi · Jun 25, 2013 at 02:54 PM
If you're using the Animation component, you need to import the rig as Legacy.
If you import the rig as Humanaoid, you need to use an Animator component (Mecanim) and an Animator Controller. You can't use animation.Play().
Assuming that you're using the legacy animation system (and not Mecanim):
Open the Animation view window (Window > Animation). Select your character. Then select an animation clip from the drop-down menu. This will allow you to view (and edit) the animation curves defined on each bone.
If you see "Clean Up Leftover Curves," then for some reason your imported model's skeleton doesn't match the skeleton defined in the animation clip.
Otherwise, you can press the play button to play the animation clip your character in-editor.
Make sure all this works before writing any code.
Thanks for the answer! Legacy makes it work.
Your answer
Follow this Question
Related Questions
FBX Animation to Sprite 0 Answers
Use Animations from fbx files? 1 Answer
Animation not playing in Play mode 0 Answers
Why does Parented FBX keep transforming to 0,0,0 when i press play? 1 Answer
can't get fbx animation to play 3 Answers