I am working on a animation that I have already completed. The animation is for my gun when I shoot I have the animation and script down. But when I shoot the gun in-game a error pops up on the console saying “The animation state ‘shoot’ could not be played because it couldn’t be found! Please attach an animation clip with the name ‘shoot’ or call this function for existing animations.” I dont understand! The animation and the script are attached to the GameObject and in the game object I cant do the “Rig Legacy method” so what do I do here is my script if it helps
#pragma strict
var Effect : Transform;
var TheDammage = 100;
function Update () {
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay(Vector3(Screen.width*0.5, Screen.height*0.5, 0));
animation.Play();
if (Input.GetMouseButtonDown(0))
{
if (Physics.Raycast (ray, hit, 100))
{
var particleClone = Instantiate(Effect, hit.point, Quaternion.LookRotation(hit.normal));
Destroy(particleClone.gameObject, 2);
hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
animation.Play("shoot");
}
}
}