- Home /
Help! Can't destroy my bullet object because is a rigidbody
function Shoot () {
// Did the time exceed the reload time?
if (Time.time > reloadTime + lastShot && ammoCount > 0) {
// create a new projectile, use the same position and rotation as the Launcher.
var bullet : Rigidbody = Instantiate (bulletPrefabs, spawnBullet.transform.position, Quaternion.LookRotation(inputRotation));
//Destroy(bullet, 3.0);
bullet.velocity = tempVector * initialSpeed;
//bullet.rigidbody.AddForce(transform.right * 2000, ForceMode.Acceleration);
// Ignore collisions between the missile and the character controller
Physics.IgnoreCollision(bullet.collider, transform.root.collider);
lastShot = Time.time;
ammoCount--;
}
}
Comment
Best Answer
Answer by Eric5h5 · Aug 05, 2010 at 04:57 AM
It's hard to tell what your question actually is, but I guess you want
Destroy(bullet.gameObject, 3.0);