Im making a mulitplayer shooter and when i shoot it fires out of the barrel using the spawnpoint i made but then it shoots really fast out of another location please help!
EDIT!!!
i tried changing the code to getbuttondown but it still fires out of the barrel plus the mag!
This is my code:
var projectile : Rigidbody;
var speed = 20;
function Update () {
if ( Input.GetButton ("Fire1")) {
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
Destroy (clone.gameObject, 2);
}}