Efficient area damage

So I’ve been wondering what is the most efficient way to do area damage. (Explosion for example)

I’ve looked up this subject but I haven’t really found a clear answer to the most efficient way all I find are people who need help with their script. or answers to a case where you need to loop which isn’t what I’m asking about.

Ways I thought of but not sure which one is more efficient :

  1. Spawn a part and use :GetTouchingParts() then deal damage to Players and NPCs
  2. Use Region3 which is abit similar to :GetTouchingParts() not sure which one is more efficient than the other
  3. Loop through all players and NPCs and calculate the distance between them and the area damage point to make sure it’s less than or equal to the range of the damage

Not sure if there are more methods , and thanks in advance.

In my opinion, you should go for Region3 or use open source modules like RotatedRegion3 by EgoMoose (RotatedRegion3 has support for different shapes like balls).

4 Likes