Camera doesn't really go to the head's position

Hey there, I have made a crawling local script that makes the camera CFrame to the head’s CFrame but the camera isn’t moving. No errors. (game is in first person)

Here is the script:

Anim:Play()
wait(0.3)
cam.CFrame = head.CFrame

You probably have to set Camera.CameraType to Enum.CameraType.Scriptable
and then if you want to reset it you can just set CameraType to Enum.CameraType.Custom

It’s already on Scriptable. charsss

Wait, what do you mean. You can’t move the camera(with mouse) or is it not moving according to the head?

I’m trying to make it so the player’s Camera move within the head, the game is in first person and has animations for example, the crouch.

Could you give us some more information about what the camera does? Also are you trying to set the camera to show the head or like the camera from where the eyes are since you said first person?

I’m not trying to make it show the head. I’m trying to make it move with the head (only when the player is croched.)

I believe you would have to use RenderStepped to achieve this since you only assigned the CFrame once which won’t update it. RenderStepped runs before every frame is rendered.

Example:

game:GetService("RunService").RenderStepped:Connect(function()
-- Code to Update the Camera CFrame
end)

Hope this helped! Feel free to message me with any questions. :smile:

I’ve only showed a part of the code, i’m using UserInputService instead

Then you could make it so when the user un-crawls you could disconnect the RBXScriptSignal. To do this assign a variable to the RenderStepped then you can do variable:Disconnect().

Example:

local runService = game:GetService("RunService").RenderStepped:Connect(function()
-- Code to Update the Camera CFrame
end)

runService:Disconnect()

I’m not trying to make another variable, I’m just telling how could I fix the camera not going “clearly” to the player’s head

You clearly said

Hey there, I have made a crawling local script that makes the camera CFrame to the head’s CFrame but the camera isn’t moving.

You never specified it wasn’t going “clearly”. But rather said the camera doesn’t move.

Yea, it doesn’t move. It justs reset the camera orientation to 0

The camera is always meant to have a distance to the cameras subject. You’re changing the CFrame to the players head which is the expected behaviour but you still have to reset the distance, and you can achieve that by doing this in your local script: game.Players.LocalPlayer.CameraMaxZoomDistance = 0

It does work but how would I fix hats and humanoid parts being visible?

Attach the camera subject to the Humanoid of the other player.

game.Players.LocalPlayer.CurrentCamera.CameraSubject = game.Workspace.PlayerCharacter.Humanoid

Not sure if you have to add a humanoid for parts but you could try that out.

In your RenderStepped script you could make each child of the Humanoid’s Avatar Transparency = 1.

1 Like

And to add to this, @AviaBasil if you’re doing this for models with lots of different instances you should probably check if the children instances have the Transparency property or are of the Part or Mesh type.