Question on how to detect any exploded bricks

As many of you know how in simulators when you destroy anything you get rewarded a certain amount of XP for that. Recently I tried remaking the system and gave up because I have no clue to how to detect if a brick or group of bricks have been exploded by a bomb any links or references to what can help will be useful

Thanks for reading :smile:

2 Likes

^All of the bricks destroyed by each team then add up to display a score to compare between each other

3 Likes

If you’re working with roblox’s explosion, Explosion.Hit is the best option for you.

If not, you can use a region3 with the same diameter as the explosions BlastRadius, then check its distance from the centre of the explosion to see if it is the range of the BlastRadius.

Region3: Region3 | Documentation - Roblox Creator Hub
To check the distance, subtract both vectors and get the magnitude of it

3 Likes

So would I insert the detect script inside the bricks or just into the bomb script to detect explosion

1 Like

Put I into the bomb script 30characters

You would need to put it in the same place on where you’d create the explosion instance. Whether it be your own explosion handler or your bomb’s script.

local explosion = Instance.new("Explosion")
explosion.Hit:Connect(function(part, distance)
-- do stuff with part
print(part)
end)
2 Likes