Ive been trying to get a recoil and a gun shooting script to link up when I press the mouse key. The game can run, but I get about a million of these:
[21253-scripting+problem+picture+1.png|21253]
Ive googled the problem and haven’t been able to find any solution, here is the script:
var projectile: Rigidbody;
var speed = 10;
function Update()
{
if(Input.GetButtonDown("Fire1"))
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3 (0, 0, speed));
Destroy(clone.gameObject, .25);
}
Any help would be appriciated.