- Home /
(blender) model not playing animation
Hi,
I have made a windmill model in Blender and added an armature and an animation to it. But I cannot get the animation working in Unity (in Blender and other model editors it shows fine).
I have imported it as fbx and set its animation type as generic (mecanim?) and added an animator component to the gameobject windmill prefab (apply root motion is ticked on & update mode = normal).
I edited the animator object in the animator window and added 2 anim states (1 is idle and 2 is rotating the rotor blades) and transitions between the two and a parameter 'RotateSpeed'.
I added a script to the windmill which runs/calls a function with the line: animator.SetFloat("RotateSpeed", bladesRotateSpeed); (also tried putting it in Update but that doesn't seem to work either)
I get no errors but the animation just doesn't show up. What am I missing?
Here is the fbx model: http://wikisend.com/download/975190/Windmill.fbx
Thanks for taking the time.
Edit- added pics (please scroll to below in the page to view the 2nd pic too): http://imgur.com/a/JeeKx
Did you assign the animation clips to those $$anonymous$$ecanim states?
Hi thanks for commenting; I am not entirely sure so I added 2 images of clips settings and the animator window.
Answer by Stents · Jun 22, 2017 at 03:46 PM
Hmm, something seems a little messed up with your FBXs animations, things seem a bit broken when it gets the the end and tries to loop. Guessing that is probably the main issue, but what have you set up as the conditions for your two transitions as well? You may be better off trying to import the Blend file directly... we've also had many issues using FBXs exported from Blender.
Btw, not sure if you only want the two states, but you may want to look into just having the single looping animation, and adjusting animator.speed in order to increase and decrease the speed of the animation... just a thought.
Hi Stents thanks for taking the time to comment and about your tip to use blendfiles. I forgot to mention something earlier, with the fbx it does show the animation in the import window in Unity, same as with a blendfile. But with both it does not show it ingame. I am not sure what it is, maybe I am missing some Root $$anonymous$$ode/$$anonymous$$otion related option or such? Or maybe the animation I did within in Blender is of another type?
Also when importing as blendfile I cannot seem to fix the rotation within Unity (with fbx I did it within the blender export window).
Setting the RotateBlades anim in the animator to the default one and muting the transitions also doesn't seem to solve this. :-( I just don't understand why it works in the import window but not ingame.
Answer by muzboz · Oct 25, 2021 at 10:51 AM
I'm not sure if this is helpful, but I was just importing a BOW & ARROW animation from Blender, and I could see the animation playing in the Importer window, but it would not play in the scene itself through the Animator (I'm using a Blend Tree).
I went back to Blender and added another keyframe after the end of my animation timeline, and exported again, and it worked!
So I think somehow, I needed to "bookend" my animations with a key "before the start" and "after the end" of my actual animations themselves.
This may help someone, one day. :D
Thanks I will add it to my notes. Last years I was not using Unity much but want to go back to it again so this will come in handy. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612124639im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Blender Walk Cycle animation in Unity3D not looping correctly. 1 Answer
Blender FBX Import to Unity messes up animations 1 Answer
FBX animations made with blender do not work properly 1 Answer
object position changed in play mode after adding animation to animator component 0 Answers
Animation works in inspector preview, but broken when in animation system 0 Answers