How can I keep the players camera synchronized with their torso?

  1. What do you want to achieve?
    I’m trying to make a first person POV that is in sync with the torso so that the torso doesn’t move infront of the camera.

  2. What is the issue?
    When the player walks forward, due to a tilting effect the torso will move slightly infront of the camera, and this is way more noticeable when the player is sprinting because the torso comes into full frame. I’d like for the camera to stay in the same perspective seen when the player isn’t moving at all.
    https://www.youtube.com/watch?v=32PbpEGeYhk

  3. What solutions have you tried so far?
    I’ve attempted to use bindable events that communicate when the player is sprinting to offset the camera a bit forwards but that isn’t nearly as smooth as I’d like it to be especially considering the tilt effect is not an instant motion and is instead a slow transition.

I’m not sure how I can go about keeping the camera in line with the torso. Any suggestions or help is greatly appreciated.

can you show some code? blah blah blah character requirement blah yeah show what you have, need to know what camera type youre using and such

the camera offset is changed, nothing else is altered

RunService.RenderStepped:Connect(function()
	local isFirstPerson = (camera.CFrame.Position - head.Position).Magnitude < 1.6

	if isFirstPerson then
		humanoid.CameraOffset = Vector3.new(0, 0, -1)
		applyShadowHack()
	else
		humanoid.CameraOffset = Vector3.new(0, 0, 0)
		revertShadowHack()
	end

	for _, part in character:GetChildren() do
		if part:IsA("BasePart") and part ~= head then
			part.LocalTransparencyModifier = isFirstPerson and 0 or 0
		end
	end
end)

This is gonna always default to 0

1 Like

mm that’s meant to be and 0 or 1 thank you but that part doesn’t affect the camera

Oh, just watched your video.

What if you make the CameraSubject the head?
Seems your Camera is “still” like how a HumanoidRootPart doesn’t move when you move.

I’m unsure if it will work but I think you should try making it so the camera moves with your characters head

1 Like

this DOES make it so that the camera is following the head however the offset no longer applies which ends up with this:

also your camera no longer rotates with your mouse so you are always facing the exact same direction

Method 1

Run UserInputService:IsKeyDown(Enum.Keycode.W) and if thats true, have it make the offset -2. I’d also lerp it so it feels smooth and slightly increase FOV to mask the effect.

Method 2 (dont recommend but can use)

get the AssembyLinearVelocity of the player’s HumanoidRootPart, then run local RelativeVelocity = Character.HumanoidRootPart.CFrame:VectorToObjectSpace(AssembyLinearVelocity), and check if RelativeVelocity.Z is negative. If it is, it means they’re going forward, and then thats your check to again lerp the offset to -2.

1 Like