local bl = part1.Position-part1.Size/2
local tr = part1.Position+part1.Size/2
Otherwise try messing around with:
local bl = part1.Position-Vector3.new(part1.Size.X/2,part1.Size.Y/2,part1.Size.Z/2)
local tr = part1.Position-Vector3.new(-part1.Size.X/2,-part1.Size.Y/2,-part1.Size.Z/2)
Aside from the solutions previously stated, keep in mind that if your part is rotated in any way, you’ll get incorrect results if you want those results to always be the part’s corners. So always keep that part’s rotation in world space.
Also keep in mind that Region3s are always axis aligned, meaning they can’t be rotated. If you need similar functionality but with rotation, search for “rotated region3”, there’s a free model somewhere that works very well.
local part = script.Parent
while wait(.5) do
local bl = part.CFrame * CFrame.new(part.Size.X/-2,part.Size.Y/-2,part.Size.Z/-2)+Vector3.new(.05,.05,.05)
local tr = part.CFrame * CFrame.new(part.Size.X/2,part.Size.Y/2,part.Size.Z/2)-Vector3.new(.05,.05,.05)
local reg = Region3.new(bl.Position,tr.Position)
print(#game.Workspace:FindPartsInRegion3WithIgnoreList(reg,{part})) --make sure your model is also in the ignore list!
end
This seems to work for me.
This is the test place I used: example.rbxl (13.2 KB)
If you’re not getting correct results from what was stated, it’s probably because you’re not handling rotations correctly. Are you sure you’re creating the region3 correctly? You should probably look into when you’re creating the rotation for the model’s final position because if it’s before the offset (the grid placement relative to the origin of the grid, which is probably the center of that part there) then what’s happening is your position starts at the origin, rotates, then offsets itself which is incorrect.