- Home /
Making detonator explosions follow the gameobject
I am using the detonator framework that is free, from the assets store. I can get it to explode and such and can instantiate example explosions, but he explosions don't follow my objects.
I have a slow moving rectangle (as an example object) and i make a missile collide with it. When my missile collides with it, it creates an empty gameobject, parents it to the rectangle, adds a Detonator script to the empty gameobject, and then the missile calls Destroy() on itself.
The result is that the explosion goes off (basic one created by detonator script) and does not follow my rectangle. The explosion looks off and is stationary.
How do i get it to follow the rectangle object?
Answer by Loius · Jan 25, 2013 at 04:59 AM
Your particles are probably set up to 'simulate in world space'. You want local space instead, if that's the case.
hmm. that sounds like it. how would i change this in the detonator framework?
I've only ever seen it once, but isn't it a small package? Open it up and find the particle system(s), then check the inspector for the word 'world' and change it to 'local'.
It has a public member saying to use world coordinates, but if i change it to false, then it changes back immediately to being true. I'll have to get all knitty gritty and look around in the package and modify it.
I wish there was a way, or something in the documentation for this. But oh well i guess.
Answer by DayyanSisson · Jan 25, 2013 at 03:42 AM
Parent the explosion to the object to the rectangle:
explosion.parent = rectangle;
I already tried that. I have my hierarchy set up like this: Rectangle---- -- (child) EmptyGameObject (with detonator script)
The explosion doesn't follow the rectangle. If i look in the inspector at runtime, it shows the empty gameobject (that has the detonator script) is indeed parented to the rectangle. When the explosion is done, the empty gameobject is destroyed, as what is meant to happen.
Your answer
Follow this Question
Related Questions
Explosion Jumpscare Script ? 1 Answer
Elevator script problem (Java) 1 Answer
How to add a function to destroy this gameobject in game. 2 Answers
Smooth Camera Follow Script, Weird Movement... Please help! 1 Answer
Problems with java script. 1 Answer