Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: blake3d on May 31, 2015, 12:05:35 PM

Title: Trying to make an explosion destroy objects around it
Post by: blake3d on May 31, 2015, 12:05:35 PM
Hello, I am relatively new to this and am struggling with something that I feel is probably simple.  I have a game object that falls into a scene and causes an explosion after a set time.  I would like it to destroy other objects close to it by its force, what should I be setting up on the other game objects to detect the explosion and destroy itself? 
Title: Re: Trying to make an explosion destroy objects around it
Post by: mdotstrange on May 31, 2015, 11:45:58 PM
I do this by having the bomb object tagged "explosion"- when it explodes it uses a send event "Broadcast all" of "explosion"- then the objects that can be damaged by it have a global transition/event called "explosion"

So when the object explodes it sends that event- then when the objects receive it they measure their distance between themselves and the object that sent the event- I use the distance with a float compare to decide if they should be damaged or not- works really well
Title: Re: Trying to make an explosion destroy objects around it
Post by: frozze on June 01, 2015, 09:50:35 AM
I do this by having the bomb object tagged "explosion"- when it explodes it uses a send event "Broadcast all" of "explosion"- then the objects that can be damaged by it have a global transition/event called "explosion"

So when the object explodes it sends that event- then when the objects receive it they measure their distance between themselves and the object that sent the event- I use the distance with a float compare to decide if they should be damaged or not- works really well

Could you post your example here, so I could play around with it? It's exactly what I'm looking for :)
Title: Re: Trying to make an explosion destroy objects around it
Post by: blake3d on June 01, 2015, 08:18:27 PM
That worked like a charm, thank you!
Title: Re: Trying to make an explosion destroy objects around it
Post by: mdotstrange on June 01, 2015, 10:55:12 PM
That worked like a charm, thank you!

I'm glad it helped  :)
Title: Re: Trying to make an explosion destroy objects around it
Post by: sturmburg on June 02, 2015, 01:27:19 PM
Would it be possible to see the example of this implementation?  Sounds like it might  be more efficient than the way I'm doing it now.

Thanks