Hello, I’ve created a Gun Animation for my FPS gun and I made a secondary script that access my Shooting script (which is on top of a empty object at the tip of my gun) and I’m having a hard time calling that animation, as I cant see what the problem is actually. I’ll post my animation script below
void Update ()
{
Shoot skott = GetComponentInChildren<Shoot> ();
if (skott.ammoPerClip > 0 && Input.GetButtonDown("Fire1"))
{
animation.Play("gunShoot");
}
}
}
I get the error, There is no ‘Animation’ attached to the “gun2” game object, but a script is trying to access it.
And in the animator, I got my animation set as default, I even drag n dropped it onto the gun so…is it a bugg or what?