Hi all,
I’m pretty new to these forums and new to Unity altogether so if anything I say seems stupid please just let it slide ![]()
Basically, I’m doing a Games Design course at University and our first project is to design a zombie game. I have made models and animated them with little problem. But I have encountered a problem trying to play an animation on clicking the mouse. The animation itself is the pumping of a shotgun. It plays when first exported into Unity (With no script attatched) so I know the animations there. But when I try to attatch a script I get nothing. I tried some different scripts I found online but still no joy.
So the script I’ve tried most recently was:
function Update ()
{
if (Input.GetButtonDown(“Fire1”)) //check to see if the left mouse was pushed.
{
animation.Play(); // if pushed play the animation.
}
}
Dont know if thats incredibly wrong or not, but any help would be greatly appreciated.