the bullets spawn and launch properly but the problem is that i have a destroy object script for 5 second which it works, after 5 seconds of the bullet being spwned it dletes itself the problem is that when it deletes the final bullet that spawned unless i keep firing, it wont spawn anymore bullets saying that Object type rigid body has been destroyed but im still trying to access it. how do i fix it hers a video :- YouTube
and my spawn script
#pragma strict
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed : float = 1000;
function Start () {
}
function Update ()
{
if(Input.GetButtonDown("Fire1")){
Fire();
}
}
function Fire(){
Bullet = Instantiate(Bullet,Spawn.position,Spawn.rotation);
Bullet.AddForce(Bullet.transform.forward*BulletSpeed);
audio.Play();
}
then delete script
Destroy (gameObject, 5);