Chain damage system

So i want to create a chain damage system using raycast, that means when raycast hits let’s say a player character it then checks around the hit point if there are any humanoids around, if so it damages them too, how would i do that?

You can find out how far away each player is from the hit point by finding the magnitude of each player.

(hitPoint.Position - otherPlayer.Position).Magnitude
-- Expected results include: 15, 74, 195, 21, ...

The smaller the number is, the closer the player is to the hit point, and from that, you can determine if the damage should be applied or not for that player.

1 Like

when a player is hit, you could instance an anchored invisible sphere at the player, and call the workspace:GetPartsInPart() method on the sphere. then you could iterate over the parts that the function returns and check the part’s parent to detect other characters that were within that sphere

2 Likes

Yeah i thought about this too, it should work soo ty

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.