Hello,
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.