I have this script right here that makes a part follow the mouse (not the full script)
render:connect(function() if moving then currentPart.CFrame = CFrame.new(mouse.Hit.p) end end)
But the problem is the part:
This is for a building system in a new game I'm making. Thanks!
You can prevent the floating effect by ignoring the part, by setting mouse.TargetFilter = currentPart
(and resetting this to nil
after the part is placed). To snap to the grid, you can do currentPart.CFrame = CFrame.new(math.floor(mouse.Hit.p.x+0.5), mouse.Hit.p.y, math.floor(mouse.Hit.p.z+0.5))
to round the x and y coordinates to the nearest whole number. If you want a different gridsize, do math.floor(mouse.Hit.p.x/gridSize+0.5)*gridSize
for the x and z.