I am trying to make a shooter game and I have a gun that is constantly firing and I have made the animation stop however I need it to start for it to fire once when the left mouse is clicked and stop the animation until it is clicked again.
Here is the code:
Animator ani;
// Use this for initialization
void Start () {
ani = GetComponent ();
ani.Stop ();
}
(with out this the gun will constantly fire.)
(Sorry I am a unity noob and am no good with code.)
↧