- Home /
How do you check what function your animation is calling?
I Have made a simple animation for a mace but when I try to swing the mace, it gives me two errors:
'Mace' AnimationEvent has no function name specified!
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) MeleeSystem.Update () (at Assets/MeleeSystem.js:12)
I read some were that it might be calling a function that does not exist. Any ideas on how to fix?
The error says it is happening in $$anonymous$$eleeSystem.js on line 12. It would be a good idea to include this script in your question to easier help you with the problem.
The error says that there is no animation object attached to the $$anonymous$$ace. You need to have an Animation component on the GameObject to play animations. The Animation component also needs to have the AnimationClip to play in its animations list.
Your answer
![](https://koobas.hobune.stream/wayback/20220613130009im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Weapon Shake 2 Answers
Select Object ( Weapon ) Quick! Help! xD 1 Answer
How do i make my attack function not work whilst animation playing? 1 Answer
Attach weapon to both hands? 2 Answers