Making the camera follow the player's head

My game is reliant on it’s animations for it to look good and I want the camera to follow the player’s head as they’re moving with the animation.

I’m able to get the effect I want, but the problem I’m having is it breaks the shiftlock which is also needed for my game. The shiftlock still works with moving the camera around, but the player will no longer turn with the shiftlock and instead the player has to jump in order for them to turn at all with shiftlock on.

I’ve looked up videos and read things on the forum trying to find ways to fix this problem. However, most of them have mentioned making a completely different camera system or shiftlock system. If that’s the only way then I’ll have to do it, but is there an easier way to achieve this?

This is the effect I want:

This is the code I’ve been using to get the effect, but again it breaks the shiftlock and prevents the player from turning with it.

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local runService = game:GetService("RunService")

local target = character:WaitForChild("Head")

runService.RenderStepped:Connect(function()
	camera.CameraSubject = target
end)