Search Unity

Very new to Unity, having issues getting the animation to link to the object.

Discussion in 'Animation' started by Jimmahdean, Dec 8, 2013.

  1. Jimmahdean

    Jimmahdean

    Joined:
    Feb 7, 2013
    Posts:
    4
    I created a simple animation which rotates and moves an object a small amount. The animator component appears on the object, but not the animation. This results in the animation playing constantly and I am unable to stop it as there is no animation component with the "Play Automatically" option. I tried dragging the animation from the assets list onto the object with no luck. Help?

    Screenshot if it helps: http://i.imgur.com/QKgvDAM.png
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Since you're using Animator, you need to set up your "Mace" controller state machine to have a stop condition. This could be a trigger or boolean set in code, or it could just use exit time (i.e. exit after the duration of the animation). You'll need somewhere for it to exit to, as well — I do character animation so I always have an idle animation for that; but I think you could just make a new state with no animation attached, and that will probably work as well.

    If you haven't watch the tutorial video on Mecanim, I highly recommend it. Search for "MecanimTute" and set aside an hour or so.

    Good luck, and let us know how it goes!