Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make an explosion useless?

I'm trying to make an explosion ignore certain parts meaning that those parts wont be affected whatsoever by the explosion.

I've tried this

explosion.DestroyJointRadiusPercent = 0
explosion.BlastRadius = 0

but it still seems to make at least 1 part fall out of place.

3 comments

0

You can anchor those parts

0

Yeah that's the issue though I need the parts to be not anchored because basically the explosion is caused from a rocket but I need it so that people can't destroy their own team base bricks but other teams can.

0

I could still anchor the parts when the rocket hits then unanchor then remake the joints but that's pretty hacky to be honest so would prefer not to do that.

1 answer

As of now, I don't think there is any way to tell an Explosion to ignore certain parts. What you can do, however, is use the Hit event to filter through all the parts that your Explosion "touched".

  1. Create your Explosion instance, and set the BlastRadius as you normally would.
  2. Set the Explosion's BlastPressure to 0 so it won't push any parts it hits.
  3. Connect a handler function to the Hit event on your Explosion. This will feel similar to hooking up a Touched event for a Part. You can also look at the example code on the page I linked above.
  4. Upon your Explosion hitting another part, use the part argument in the handler to decide whether or not to actually put force on it.
  5. Create your own BodyForce Instance and add it to parts you want to affect with the explosion. There is a good example of how to calculate the force and direction of this custom BodyForce in the LinkedRocketLauncher from Roblox.

This discussion is preserved as it was. New answers, comments, and votes are closed.