So in a game, I need to work out if a player is within a certain space. Im torn between using region3 or using a part and checking if the players’s HRP is near using the following code:

```
function module.CheckIfNearXYZ(Part1, Part2Position, Leniency)
local relativePos = Part1.CFrame:pointToObjectSpace(Part2Position)
if math.abs(relativePos.X) <= Part1.Size.X * Leniency * 0.5 and math.abs(relativePos.Y) <= Part1.Size.Y * Leniency * 0.5 and math.abs(relativePos.Z) <= Part1.Size.Z * Leniency * 0.5 then
return true
else
return false
end
end
```

for the sake of the example Leniency = 1.

What do you guys personally use and recommend?