- I don’t quite understand how I can get the min and max from an object cause I’m not very good at math. I watched some tutorials on region3 and look at some topics on the devform but couldn’t find the answer so if someone can explain it to me that would be nice.
- Trying to get the min and max from this
Use :GetPartsBoundsInBox()
instead, it’s a much better alternative of findpartsinregion3 (also might be deprecated soon) and easy to use, and you can use a part’s cframe and size directly:
workspace:GetPartsBoundsInBox(part.CFrame, part.Size, overlapParams)
1 Like
I know you can use that but I’m trying to learn this because I think it might get deprecated soon.
1 Like
You can get the Min
and Max
vectors by creating 2 vectors from Size
vector divided by 2 (With one of them being inversed.) and transform them to world coordinates by using the Position
CFrame:
function ToMinMaxVectors(self: Region3): (Vector3, Vector3)
local Position: CFrame, Size: Vector3 = self.CFrame, self.Size / 2
return Position * -Size, Position * Size
end
1 Like