I’m trying to make a building system and have a box that shows the position that the object is going to be placed at.
But when I try to detect collisions using Part:GetTouchingParts() I’m having the problem that it says there’s collisions even though the table that the function returns is empty.
Code:
while true do
part1:PivotTo(CFrame.new(Vector3.new(mouse.Hit.X,mouse.Hit.Y+(part1.Size.Y/2),mouse.Hit.Z)))
if (part1:GetTouchingParts() == {}) then
colliding = false
part1.Color = Color3.fromRGB(0,255,0)
else
colliding = true
part1.Color = Color3.fromRGB(255,0,0)
end
print(colliding)
print(part1:GetTouchingParts())
wait()
end
output:
true
{}
true
{}
etc