Camera Not Following Player Head Rotation

Yes, it is. I’m using it in combination with a ragdoll script.

it might be that the script stops before working, put out prints in different parts of the code to see where it stops.

1 Like

With the print’s I have found out that it wont get past the part where it define sthe CurrentCamera Subject and CameraType

is the code that you provided all the code of the script?

1 Like

try this new code, i think the problem was the *.Subject

local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait() -- if character does not exist we will wait for it to exist.
Head = Character:WaitForChild("Head") -- Get's the Player head in Workspace

local RunService = game:GetService("RunService") -- Defines RunService

workspace:WaitForChild("CurrentCamera").CameraSubject = Head
workspace:WaitForChild("CurrentCamera").CameraType = Enum.CameraType.Scriptable -- Sets CameraType to Scriptable

RunService.RenderStepped:Connect(function()
	workspace.CurrentCamera.CFrame = Head.CFrame -- Should set the Camera CFrame to the head, but that is not happening
end)

I’m completely out of my mind. It still isn’t working.

does it still get stuck in the same line as before?

Yes, it also seems that I am getting a infinite yield possible warning
afbeelding

remove the WaitForChild, replace them with

workspace.CurrentCamera.CameraSubject = head
workspace.CurrentCamera.CameraType = Enum.cameraType.Scriptable

1 Like

That works! O my god!
It isn’t perfect, let me show you:
https://gyazo.com/7ead2d7f7d00287a824c67075454e0da

awesome! and if you want, you can make your hats transparent locally, and maybe add a custom walk animation without head movements to not make it wobble as much

Well I was already using R6, so the head doesn’t move.
But now there is still a problem: I can’t turn the camera with the mouse as in first person.
EDIT: I know why the head is acting weird: it is because I added a script that made my head move to the mouse position

are all your playergui’s Modal is set to false, also going fullscreen (if not already) might fix it

so everything is fixed and there are no more problems?

1 Like

Nope! Only one, that is that i cant use the mouse to rotate the player.