Read the title
For example :
I have a part at position 0, 5, 0 with size 10, 10, 10. Is there a way to check if there a part at 1, 1, 1? It must return the part at position 0, 5, 0.
Read the title
For example :
I have a part at position 0, 5, 0 with size 10, 10, 10. Is there a way to check if there a part at 1, 1, 1? It must return the part at position 0, 5, 0.
You can use GetPartBoundsInBox. You can pass the Vector3 position (giving it as a CFrame), choosing a small size for the box and optional OverlapParams. It will return an array of parts that touched the bounds you specified. It will be empty if no parts are touching it.
If you don’t understand let me know and I’ll give you an example.
local function CheckIfPartInPlace(Position, Size)
return workspace:GetPartBoundsInBox(CFrame.new(Position), Size)
end
if #CheckIfPartInPlace(Vector3.new(0, 5, 0), Vector3.new(10, 10, 10)) > 0 then
print("Part in space")
end
https://developer.roblox.com/en-us/api-reference/function/WorldRoot/GetPartBoundsInBox