I can think of two ways to do this.
-
Cast a bunch of rays out from the origin of the explosion, check if what they hit is a player, if it is a player and they are within a certain vicinity, damage them.
-
Get every player within the game, and cast a ray from the explosion to the direction of their torso. If the ray isn’t interrupted and they are within a certain vicinity of the explosion, damage them.
Which way is best (if any)? Thank you.