The animation state GunShot could not be played because it couldn't be found! Please attach an animation clip with the name 'GunShot' or call this function only for existing animations.

Hi am having an issue, I am making a first person shooter type game, and once i enter the script function Update () {
if(Input.GetButtonDown(“Fire1”)) {
var gunsound : AudioSource = GetComponent.();
gunsound.Play();
GetComponent.().Play(“GunShot”);
}
}

everything works when i hit play as far as walking goes, but when i shoot my gun - i get the above error and it automatically play and pause at the same time - how do i correct this issue

thanks in advance

What you want to do is read up a bit about mecanim. Don’t use the system you are using for animations. Definitely use mecanim. If I were you I would back up and do some mecanim tutorials before trying to continue.

Thank for answering, I am not very good with Mecanim - but i guess i could try it again. was making this game for a school project. but when errors like this start i get stuck and not sure what i did wrong. -