Disable “Play Automatically” in the animator component

After hours of searching on the internet I haven’t ben able to find a solution to my problem. The problem I have is that my animation that I create is constantly looping, even though I have a script that tells it to only play when I press a certain button. I have read that you can disable the animation loop by unchecking a box named “Play Automatically,” although this must have been in an oder version of Unity, but in the one I’m currently using (4.5.3f3) the Animator component looks like this:


rather than this in the older version:


Any ideas on how to disable the “Play Automatically function?

P.S. My hours of research provided two possible solutions, although none of them worked:

  1. Create an “Empty State” in the Animator and set it to default. [this did not work because when I pressed the key that was supposed to start the animation, nothing happened]

  2. Change the animation type from 1 (Mechanim) to 2 (Legacy) using the Debug mode in the Inspector. [this didn’t work either as the animation completely stopped playing]

Thank you in advance for taking the time to help me out.

Your script needs to play (call) the state not the animation clip when using Mecanim:

Here are some great learning resource to help with this:

Thanks for the advice, but I managed to find out what was wrong. For all those who stumble across this post in the future with the same problem I had, you have to use an “Animation” component, not an “Animator” one. (You can assign this by clicking on “Add Component”, “Miscellaneous” and “Animation.” This will contain the “Play Automatically” button you were looking for.