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
Closed as Non-Descriptive by SerpentineKing and DeceptiveCaster
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?