Question about part detection functions

I had a small question, for my game i have a Hitbox part that i use to show, well, the hitbox of a attack, but i was unsure if i should use either workspace:GetPartsInPart() or workspace:GetPartBoundsInBox(), as i dont know which one is more performance-friendly and accurate.

(To clarify, the hitbox is a square, as far as i know tough, for spherical ones i should use getPartsInPart)

1 Like

Within the documentation for GetPartsInPart() it states that the alternatives, GetPartsBoundInBox() and GetPartsBoundInRadius() are less accurate, but perform much more efficiently:

For spherical volumes, you could use GetPartsBoundInRadius if performance matters over the accuracy.

Sweet, thanks for the simple and clear response!

1 Like

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