I’m making a plot system with a scaling feature and when the player wants to place the part I’ve been using overlap params to check if the part’s inside the plot area. The problem with that is it checks from the middle of the part so players could do weird things like this (image below) and place parts half outside the plot.
I’ve tried everything from region3 to :getTouchingParts() to get this to work and I’ve gotten no where.
This is the code that I’ve been using to check if it’s inside the plot;
local overlapParams = OverlapParams.new()
overlapParams.FilterDescendantsInstances = {workspace.Baseplate,plot,DummyBlock.Block,Child}
overlapParams.FilterType = Enum.RaycastFilterType.Blacklist
local boxTouching = game.Workspace:GetPartsInPart(plotbox,overlapParams)
for i,part in pairs(boxTouching) do
if part.Parent == "Block" then
Place() return
end
end
Why don’t you check if all the corners are inside the area instead of only the center? You can get the bounding box and then check for all the corners.