- Home /
Animation won't play? Please help!
I have recently upgraded to unity 5. I have been making an android game which contains quite a few animations. I created them on unity 4 and they automatically played and looped. Since I have upgraded to unity 5 these animations will not even play in-game. Like it was in unity 4 I need the animation to automatically start and then loop until the scene ends. I have no idea how to do this. Please help!
Answer by Rosehardt · Mar 31, 2015 at 03:08 PM
"I had the same problem with an animation and I found it is related to the 'Static Batching' feature present in Unity 5. Here is how I solved it:
Select the object you are animating.
In the Top-Right corner of the Inspector window you'll see a drop
down list near to the Static label,
click on it.Uncheck the 'Batching Static' option."
Source: http://stackoverflow.com/questions/28856600/animation-not-working-unity-5/28859706#28859706
Batching Static is already disabled. Still have no idea what it is.
I know this is kind of late but for anyone who has a problem... $$anonymous$$y "Batching Static" option was already unchecked and checking it actually fixed my whole animator for some reason.. Hope it helps for anyone else who revisits :)
Answer by cboxgo · Dec 13, 2015 at 02:47 PM
I'm not sure if your problem is the same as mine was, but you may be doing:
Time.timeScale = 0f;
this will prevent your animation from running if the Animator is set to Normal update mode. To get around this, set it to UnscaledTime in the animator settings or put this line in your code:
<Animator>.updateMode = AnimatorUpdateMode.UnscaledTime;
Wow thanks... I spent an hour trying to animate some canvas elements and this fixed it. That being said I don't understand where and how Time.timeScale is being set to zero. It's not.. otherwise everything would stop moving right?
Thank you! I do forget to reset the timeScale from the pause scene. That saves my day.
OMG @cboxgo you have no idea how long I've been searching for this. Thank you very much for this post. 6 years later you still saving the day.
Answer by oye_beto · Sep 02, 2015 at 09:37 AM
Try selecting your animation clip in the Project window then change the Inspector window to Debug by right clicking its tab.
Now you should be able to set Legacy to true.
You can also select Wrap Mode to Loop if you need it.
Answer by carldevelopsforcoffee · Aug 25, 2017 at 02:45 AM
I encountered animations randomly not working, the fix was to disable then enable the animation. This resets something in the animation system and playing works fine after.
Answer by ZiyadMM · Oct 28, 2018 at 01:16 PM
a bit old question but this could help others as well, if you are using layers, make sure you have the correct layer mask with relevant skeleton items selected and not conflicted with other layers.
remove the layer mask and try playing the animation to make sure about this issue.