I’m trying to make the camera locked to the players head at all times, using the following code in a localscript:
local Players = game:GetService('Players')
local Player = Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
game:GetService("RunService"):BindToRenderStep("TrackHead", Enum.RenderPriority.Camera.Value, function()
Humanoid.CameraOffset = (HumanoidRootPart.CFrame + Vector3.new(0, 1.5, 0) ):PointToObjectSpace(Character:FindFirstChild("Head").Position)
end)
It works fine usually, but does not lock onto the player’s head in shift lock during any animations that move the head. (Does not happen when not in shift lock.)
You can see this problem clearly by jumping with R15 avatars when using the code.
Are there any ways to solve this issue?