Script for tank fire

I am making game in the spirit of Tank battle arena, and I need a script for my tank to fire( if you happen to know some ), or at least some hints for me to do it on my own. Thank you in advance for your involvement. :slight_smile:

//Create a rigidbody prefab and put it here
var shell : Rigidbody;

//Make an empty gameobject and put it at the end of the barrell
//Then assign it in the editor as this variable
var muzzle : Transform;

function Update () {

  if(Input.GetMouseButtonDown(0)){

    Instantiate(shell, muzzle.position, muzzle.rotation);

    //Makes the shell move
    var forward = transform.TransformDirection(Vector3.forward);
	instantiatedBullet.AddForce (forward * 1000);
  }

}

Hope this helped you :wink: