Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

MissingComponentException problem

Discussion in 'Animation' started by Drunky, Nov 25, 2013.

  1. Drunky


    Nov 25, 2013
    Hey there. I am very new to unity, so please keep your answers (if any) simple. I have been following the youtube guide to creating a survival game in unity and everything was going fine, until I tried the animations. Although I did everything according to the video ( which means that I created the animation and linked it to the script, whenever I click to attack (it was a melee hit animation) I get the error "MissingComponentException: There is no 'Animation' attached to the "Mace" game object, but a script is trying to access it.
    You probably need to add a Animation to the game object "Mace". Or your script needs to check if the component is attached before using it.
    UnityEngine.Animation.Play (System.String animation) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/Animations.cs:568)
    Melee_system.Update () (at Assets/Melee_system.js:13)"

    What could I be doing wrong? I could send you the script if you'd like (just say so), but I'm pretty sure I did everything exactly the same as the guy in the video did.