I made a script which is supposed to make the head follow the mouse up and down in a game with a 2d camera view and it's acting a bit weird
local RunService = game:GetService("RunService")
local player = game.Players.LocalPlayer
RunService.Stepped:connect(function()
local character = player.Character
local mouse = player:GetMouse()
if character then
character.Head.Neck.Transform = character.Head.Neck.Transform * CFrame.new(Vector3.new(0,0,0),Vector3.new(0,mouse.hit.p.y,mouse.hit.z))
end
end)
I know that if I want the head to just go up and down I probably don't need to use mouse.hit.z, but the thing is that if i change that to something else it looks weirder, and if I put it to 0 the character disappears entirely.
