- Home /
Instantly Destroy Surrounding Objects (Grenade)
Does any one know the code to specifically Destroy Objects around the grenade explosion radius, instead of force pushing them away? Also is it possible to make the objects shrink to 0 before being destroyed?
Answer by hameed-ullah-jan · Jun 10, 2019 at 09:08 AM
The best and easiest way to achieve this, would be to use events and delegates. you can trigger an event whenever the bomb blasts, and associate handlers with this function which will check if the distance between the bomb and the object is less then a specific value you can destroy those objects. you can find an example of events and delegates in this tutorial: https://www.youtube.com/watch?v=qwQ16sS8FSs
Thanks, i'll try and figure it out from that video in the future, too worn out to learn that at the moment, it's a lot more effort than i was expecting >.< Thought i'd just have to add DestroyObject(); ins$$anonymous$$d of force push or something simple like that.
Answer by AdamEarlston · Jun 10, 2019 at 07:57 PM
Just had a brilliant idea >.< I tried tweaking my script from Brackey's Destroy/Shatter guides and i couldn't tweak it for destroying before, so i am going to make my shattered version be a shrunken version if possible, and my grenade can be a shrinking grenade >.<
Quick question, if you are going off of a tutorial, and are asking a question relating to it, wouldn't it be better to go to that creator's forum if they have one? It's just a suggestion.
Good suggestion, wasn't aware of such things.