randomize lifetime of detached parts

This commit is contained in:
in0finite 2020-06-20 18:06:24 +02:00
parent bfb15e4c9c
commit b0cde397be

View file

@ -159,7 +159,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
rigidBody.maxDepenetrationVelocity = VehicleManager.Instance.explosionLeftoverPartsMaxDepenetrationVelocity; rigidBody.maxDepenetrationVelocity = VehicleManager.Instance.explosionLeftoverPartsMaxDepenetrationVelocity;
rigidBody.AddExplosionForce(explosionForce, explosionCenter, explosionRadius); rigidBody.AddExplosionForce(explosionForce, explosionCenter, explosionRadius);
Object.Destroy(meshFilter.gameObject, VehicleManager.Instance.explosionLeftoverPartsLifetime); Object.Destroy(meshFilter.gameObject, VehicleManager.Instance.explosionLeftoverPartsLifetime * Random.Range(0.8f, 1.2f));
} }
} }