I made an attempt to accomplish this:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() while true do local bob = game.Workspace.Bob bob.Position = Vector3.new(mouse.Hit) end
I read that you need to use Mouse.Hit for it's position but I am probably wrong. What's the proper way to get the position of the mouse?
mouse.Hit
will return the mouse's CFrame, you need to add a .p
to mouse.Hit
to get the position like so, mouse.Hit.p
, or you could just change bob's CFrame, instead of Position.
local plr = game.Players.LocalPlayer local m = plr:GetMouse() game:GetService("RunService").RenderStepped:Connect(function() local bob = workspace.Bob if bob then bob.CFrame = m.Hit end end)