Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I find the area of two overlapping parts in the overlap zone?

Asked by
samy22 10
10 years ago

Does anyone know how to create a part in the existing overlapped space within a part?

So far, i've got a script which prints the parts which overlap. However, is it even possible to find out the size and position of the part in the overlap zone?

function getPartsInPart(p) local v1=(p.CFrameCFrame.new(p.Size.X/2,p.Size.Y/2,p.Size.Z/2)CFrame.new(-0.5,-0.5,-0.5)).p local v2=(p.CFrameCFrame.new(p.Size.X/-2,p.Size.Y/-2,p.Size.Z/-2)CFrame.new(0.5,0.5,0.5)).p return workspace:findPartsInRegion3(Region3.new(v2,v1)) end

a = getPartsInPart(Workspace.Base) for i=1,#a do print(a[i]) end

tl;dr how much of the part is inside it?

(I want to create a part of size and position equal to that exact size and position in the overlap zone.)

Answer this question