Problem with mouse.hit?

I am trying to make it so that a part follows the mouse

Basically, the mouse is on a baseplate, then the part moves to the mouse, now the part is on the mouse, so the part goes to the mouse, but the part is on the mouse, so it moves like this in a weird way instead of a smooth way.
shown bellow

How can I fix this?

Here is the code inside StarterPlayerScripts

local plr = game.Players.LocalPlayer
local part = Instance.new("Part")
local mouse = plr:GetMouse()
part.Parent = game.Workspace
part.CanCollide = false
part.CanTouch = false

while wait() do
	part.Position = mouse.Hit.p
end

You can search it up, I searched up “roblox part mouse.hit moves towards camera” and found this:

2 Likes