Im making a shooting game and i really need to add to my script to make the bullets disappear in 2 seconds
var bullet : Transform; //Your bullet prefab.
var speed : float = 10.0f;
var muzzlePoint : Transform; //Your SpawnPoint
function Update() {
if(Input.GetButtonDown("Fire1")) {
var instance : Transform = Instantiate(bullet, muzzlePoint.position,
muzzlePoint.rotation);
instance.velocity = muzzlePoint.forward * speed;
}
}
could anyone please edit this script for me! thanks!