0

# How to insert a region 3 in the same position and at the same size as a part?

Asked by 3 days ago
Edited 3 days ago

Ive been looking for a way to put a Region3 in the position of a part, and In my search I found this

local RegionPart = game.Workspace.RegionPart
local pos1 = RegionPart.Position - (RegionPart.Size / 2)
local pos2 = RegionPart.Position + (RegionPart.Size / 2)

local Region = Region3.new(pos1, pos2)


And, im just wondering how that actually works. How does that get the corners of a part?

1
The way how it works is that Position property in Roblox returns position of the part's center, here is image of what i mean. Now Size returns the part's size but since we have the middle position, we don't need to add whole size to the position because our position is in middle, that's why you divide it by 2 to get the edge. Here is illustration of what i mean.