Head follows camera differently when turned around

Trying to make head following camera thingy, but whenever I spin the camera to the right or left, the up and down tilt is different. (lighter? weaker? in a way) I just know it’s something simple, but I literally cannot figure it out :pray:

Is it the way roblox camera works? Is it something to do with the camera FOV?

the code:

function PlayerController:updateHeadFollow(dt)
	if self.headFollow then
		local cf = self.headFollow --this is just the player's camera cframe 
	
		local character = self.player.Character
		local root = character.HumanoidRootPart
		local r = root.CFrame:ToObjectSpace(cf).LookVector

		--local y = - look.Y --- math.rad( math.clamp(math.deg(look.Y), -45, 45) )
		local y = - r.Y / 2
		
		
		self.animator:move('neck', CFrame.Angles(y,0,0), 5*dt)
		self.animator:move('root', CFrame.Angles(y,0,0),  5*dt)
		self.animator:move('leftLeg', CFrame.Angles(0,0,-y), 5*dt)
		self.animator:move('rightLeg', CFrame.Angles(0,0,y), 5*dt)
	end
end

1 Like

I tried debugging the Y angle to see if it actually changed when I spun or if the issue was related to :move function. The angle was fine, so I started sending just the angle instead of the entire camera CFrame—and that fixed it. I still don’t know why that was a problem, considering the calculations are literally the same…

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