im trying to figure out how would I know if a part is in bounds or inside a part. ive tried looking up questions about it, but none of them give a good answer than just "check if the position is in bounds of the part". If someone can give me an idea of how would i do that would be appreciated.
edit:
found a way to determine if its in bounds or not of a part:
local target = workspace.target
local corner1 = script.Parent.Position-script.Parent.Size/2
local corner2 = script.Parent.Position+script.Parent.Size/2
local function createPart(pos,name)
local part = Instance.new("Part")
part.Anchored = true
part.Size = Vector3.new(2,2,2)
part.CFrame = CFrame.new(pos)
part.Name = name
part.Parent = workspace
end
createPart(corner1, "1")
createPart(corner2, "2")
if corner1.Z <= target.CFrame.Position.Z and corner2.Z >= target.CFrame.Position.Z and corner2.X >= target.CFrame.Position.X and corner1.X <= target.CFrame.Position.X then
print("in bounds")
end

6 comments
I'm not sure what you are trying to do here...
https://scriptinghelpers.org/questions/31289/how-can-i-make-players-only-be-able-to-build-in-a-certain-area something like that
But...the question is answered...
look at my question again mate
The simplest ways would just to use gettouchingparts() or region3
Use magnitude.