- Home /
Animation state could not be played because it couldn't be found!
Hello guys,
I'm new to unity and I'm using the latest version of the product.
Currently, I have an issue and I wasn't able to find a solution: 1.I've added in the scene view the First Person Controller 2.I've added an empty game object which contains some script code as child of the first person controller. 3.In the empty game object I've added a simple "weapon" ( cylinder+sphere where the cylinder is the child of the sphere )
I've made a simple animation for the "weapon" object in unity and I've added it in the "weapon" animation from the inspector.
In the script from the emtpy object I've assigned the "weapon" object to a variable which tpye is Transform WeaponName;
When I click , it should play the animation ( WeaponObject.animation.Play("Hit"); ) but I'm getting the error I've mentioned above.
If I add the option "Animator" to the weapon object , it automatically plays the animation and I don't want it to always play.
What can I do?