How do i make a part disappears when an explosion touches it?

Im trying to make a game like bomberman but, since i’m bad at this i don’t know how to make a part disappear when an explosion touches it

for example when this explosion happens i would like that part to be destroyed


anyway to do this?
the video is a little jumpy so if any more info is needed, I’ll send it.

1 Like

You could create a hitbox around the explosion area, then if it touches a box, delete the box

Use the Explosion.Hit event to detect when the explosion hits a part, then check if the part should be deleted.

local explosion = --Path to explosion
explosion.Hit:Connect(function(hitPart,distance)
	if(--[[Part should be destroyed]]) then
		hitPart:Destroy()
	end
end)
1 Like

well the the explosion is being made though instance.new so I have no idea how to set the path to it.

If you’re instantiating an Explosion then all you have to do is store it as a variable.

local explosion = Instance.new("Explosion")
explosion.Hit:Connect(function(hitPart,distance)
	if(--[[Part should be destroyed]]) then
		hitPart:Destroy()
	end
end)
2 Likes