Ah, you can do a simple formula, replace the Y Axis (or the Axis which suits best) from the vector with the position and size of the Baseplate plus the “radius” of the part; the Axis Y (or the Axis wich suits best) / 2.
Basically don’t use the complete vector, instead “attach” an Axis to your preference.
If you don’t understand this I could think more.
So first we got the position and you set the workspace.Part.Position:
workspace.Part.Position = Mouse.Hit.Position
Instead of setting the position directly to the mouse position; “attach” some Axis wich suits best for (in this case the Y Axis from the Vector3), to the Baseplate.
How we do this?:
local basePlate = workspace.Baseplate
local size, position = basePlate.Size, basePlate.Position
local radius = workspace.Part.Size.Y/2
local positionY = position.Y + (size.Y/2) + radius
Mouse.Move:Connect(function()
if Mouse.Target ~= nil and Mouse.Target ~= workspace.Baseplate then
local cf = Mouse.Hit
local position = cf.Position
workspace.Part.Position = Vector3.new(position.X, positionY, position.Z)
workspace.SelectionBox.Adornee = Mouse.Target
Mouse.Icon = "rbxasset://SystemCursors/PointingHand"
else
workspace.SelectionBox.Adornee = nil
end
end)