So, when this bomb explodes, it does damage to surrounding blocks. But to do so, I loop through the blocks folder, which might not be how to do it right. But raycasting might be easier since it’s not looping through over 600 objects. Also, if I were to raycast, can someone put an example statement? Since I learned simple raycasting about a couple weeks ago.
Just a side note, when it explodes, all it does is play a sound, and summon an explosion object then adds it in to debris. Right after is the for loop.
Assuming you’re not using the roblox explosion object then
You can use this function instead https://developer.roblox.com/en-us/api-reference/function/WorldRoot/GetPartBoundsInRadius
Give it a whitelist of all the damageable blocks for max optimal usage, if you need it more performant then there are ways but it takes a lot of time to implement, and this is generally the quickest way… This should be more optimal then your current method and the raycasting method