I am building a FPS (not the tutorial) and I built a series of animations for a gun model using Maya (a .mb file). I have imported the animations, and written a basic script that runs the bolt slide animation when you click the mouse (and fire the weapon) here is the script:
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
animation["Element 0"].wrapMode = WrapMode.Once;
animation.Stop();
}
}
however, when I run this script, I get a "Null reference exception" message in the debug window, what is the error?
Thanks