Detonator problem ...


I have a problem with the Detonator assets from Unity. When I go to the demo scene of detonator, all the explosions work well but when I want to use it in my scene, the explosion doesn’t work. I created a sphere representing a bomb, added a sphere collider and then I putted this script on it. I can clearly see the “Detonator (Clone)” in the list of object but there is no explosion nor a sound.

var explosionPrefab : Transform;

function OnCollisionEnter(collision : Collision) {

 var contact : ContactPoint = collision.contacts[0]; 
 var rot : Quaternion = Quaternion.FromToRotation(Vector3.up, contact.normal); 
 var pos : Vector3 = contact.point; 
 Instantiate(explosionPrefab, pos, rot); 
 Destroy (gameObject);

Thank you.

im goign to guess your explosive doesnt have a collider attached and/or a rigidbody to enable it to collide with other objects. Check to make sure you have added both. (dont just add a collider alone without a rigidbody, you can read up on why you shouldnt do that and when you should but for these purposes dont)