Hi, I’m trying to get a part to follow the player’s cursor when ever they move it however I can’t seem to get it right. Any help would be appreciated. (Script in StarterPlayerScripts btw)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:Connect(function()
workspace.Part.CFrame = Mouse.Target.Position
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local part = workspace:WaitForChild("Part")
mouse.TargetFilter = part
mouse.Move:Connect(function()
part.Position = mouse.Hit.Position
end)
I believe this is what you were trying to achieve.