I have a part that is a reference for the region in question and since it is rotated the region ends up just being a diagonal line. How can I make it cover the reference part?
--Scan structures--
for _,v in pairs(regionPart:GetChildren()) do
local newMin = v.CFrame:ToWorldSpace(CFrame.new(-(v.Size/2))) --Minimum value
local newMax = v.CFrame:ToWorldSpace(CFrame.new(v.Size/2)) --Max value
local structureRegion = Region3.new(newMin.p,newMax.p)
v.CFrame = structureRegion.CFrame --Visualize the Region
v.Size = structureRegion.Size
v.Transparency = 0
for _,v in pairs(workspace:FindPartsInRegion3WithWhiteList(structureRegion,{new})) do
print("Found")
found = false
break
end
end