I was making something and I want a brick to follow the mouse but on the nearest surface that the mouse is over. I have this:
wait(.25)
mousepointto = mouse.Hit.p
brick.CFrame = CFrame.new(mousepointto)
mouse.Button1Up:Connect(function() ... end)
inside a while true loop. It works fine but snaps to the position of the mouse and is not able to overlap other object other objects. I want to make the movement smoother and have the ability to overlap objects.
Anyone have any ideas on how I can do this? brick.Position = mousepointto has the same effect as CFrame

2 comments
Srry I have no idea what you mean. I agree that the mouse in general is 2-dimensional but Hit is the Position is 3D space since if you snap a brick it will show up where the mouse is pointing to. I really want it to let the player use mouse movement to place the object
Yes, but since the mouse is 2 dimensional, we have no idea of knowing what the position the mouse is on the Z axis. Because of this, the Z axis is automatically assigned to the position where the mouse 'hits' another object. That is why when you CFrame the part to the mouse's hit property, it still does not go through other parts.