- Home /
Detonator problem ...
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.
Have you set the explosionPrefab variable? Are you getting any errors or warnings?
Answer by sparkzbarca · Dec 27, 2013 at 01:54 PM
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)
Your answer
![](https://koobas.hobune.stream/wayback/20220613124943im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Explosion Elimination script 2 Answers
Detonator Explosion Framework Black squares around fireball 1 Answer
Unity Explosion Framework didn't work 0 Answers
Making detonator explosions follow the gameobject 2 Answers
unknown identifer explosion problem 2 Answers