I am working on a mechanic in my game where when the mouse is moved, the camera moves along with it. But I am facing a very weird bug that I cannot figure out. When I run this code:
local m = game.Players.LocalPlayer:GetMouse()
local c = game.Players.LocalPlayer.Character
local h = c.Humanoid
local p = {m.X, m.Y}
it outputs with this error:
[Players.Grayseon.PlayerScripts.LocalScript:3: attempt to index nil with ‘Humanoid’
I have already tried to change the wording to it, even simply making the script use FindFirstChild in the workspace to find ‘Grayseon’ but it still has that error.
Also, this is a LocalScript in StarterPlayerScripts.