MissingComponentException: There is no ‘Animation’ attached to the “Melee” game object, but a script is trying to access it.
You probably need to add a Animation to the game object “Melee”. Or your script needs to check if the component is attached before using it.
That is the full error i get. I’m trying to animate a weapon so that it swings when i click the ‘melee’ button to damage the enemy. It is referring to this line of code:
animation.Play(“MaceAttack”);
I would very much appreciate a reply. I have scrapped my whole game and restarted and I still get that error. Oh, and the animation is attached to the gameObject ‘Mace’ and not ‘Melee’. When I attach the animation to Melee it does nothing.