I want to make a move tool kind of like the one in Make a cake and feed the giant noob. So I know what 'mouse.target' does but how do I use 'mouse.hit'?
The .Hit
property of the mouse is the CFrame of what the mouse is pointing at, where as .Target
is the BasePart
the mouse it pointing at. In other words, mouse.Hit
is a CFrame, where as mouse.Target
is a basepart or nil.
-- example script: Make Part where you click -- local script in ReplicatedFirst (Or wherever else LocalScripts run) local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.Button1Down:Connect(function() local part = Instance.new("Part") part.Anchored = true part.CanCollide = false part.CFrame = mouse.Hit part.Parent = workspace end)