How can I make the camera follow the head's movement? (like pc2)

I was wondering if could I make the first person camera follow the head’s movement, preferably similar to pillar chase 2. In that game the camera in rounds seems to follow the movement of the head smoothly, without it breaking or being everywhere. I don’t think it works by just setting the cframe to the head’s.
Any idea of how it works could help

As to why I don’t think that works, when I do that, it breaks quite a bit:

  • doesnt turn the natural way
  • when walking backwards it keeps spinning in circles

basically I want to achieve this effect without affecting how would the camera actually work, kinda like just offsetting it

bumping this in case anyone knows

this was actually covered on another topic, but here is the solution regardless

local runservice = game:GetService("RunService")

local char = script.Parent
local hrp = char:WaitForChild("HumanoidRootPart")
local head = char:WaitForChild("Head")
local humanoid = char:WaitForChild("Humanoid")

runservice:BindToRenderStep("HeadMovement", Enum.RenderPriority.Camera.Value, function()
	local object_space = (hrp.CFrame + Vector3.new(0, 1.5, 0)):ToObjectSpace(head.CFrame)
	humanoid.CameraOffset = object_space.Position
end)

lmk if you have any issues

1 Like

Could you link the topic by any chance? Maybe I could learn more, dunno

i was able to find it!
i’d advise against using the model, though, since it looks like THIS…


yeah, pretty messy… also, sorry for the flashbang :smiling_imp:

they don’t really explain how it works… it’s a bit complicated to be honest, xD.
so i’m not really the guy to talk to about cframes as they are a menace to me and my wellbeing and their methods horrify me but i found this video to be quite informative and helpful. i hope you can also understand it since it’s admittedly a little bit complicated, and the formula to get the method being CFrame:Inverse() * cf is really not helping. regardless, i hope you learned something new.

have a good day!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.