- Home /
Detonator Kit, Explode when hitting key
I'm using the Detonator Kit for Unity and it's really fine but I'm really new to Unity and i got a question.
1) create an empty gameObject, named "kawoom" 2) component menu / detonator / detonator and add it to my new "kawoom" gameObject 3) hit play, works great 4) uncheck "Explode On Start"
now here's my problem, i really have no idea where to put the Explode()
thanks
Depends when what you want to set off the explosion, if not at the start. What did you want to trigger it?
Answer by bert · Jul 29, 2010 at 02:52 PM
okay, maybe there are other and better ways but this one works.
var kawoom:Transform;
function Update() { if (Input.GetKeyDown (KeyCode.X)) { var instanceOfDetonator = Instantiate(kawoom, transform.position, Quaternion.identity); } }
i can attach it on any gameobject, just have to connect the detonator prefab to it. now when i hit "X" on the keyboard, the gameObject shows a nice explosion :)
I like that approach. In a project I'm on, we have different explosion prefabs, that we just instantiate. It works well.
Your answer
Follow this Question
Related Questions
Setting timed detonations with the detonator kit 2 Answers
Unity Explosion Framework didn't work 0 Answers
Detonator and it's volume threshold 0 Answers
Detonator Framework works, but explosion edges are noticeable 1 Answer
detonator question 2 Answers