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 :
- Spawn a part and use :GetTouchingParts() then deal damage to Players and NPCs
- Use Region3 which is abit similar to :GetTouchingParts() not sure which one is more efficient than the other
- 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.