Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local camera = workspace.CurrentCamera
- local character = game.Players.LocalPlayer.Character
- local root = character:WaitForChild("HumanoidRootPart")
- local neck = character:FindFirstChild("Neck", true)
- local yset = neck.C0.Y
- local Cframe, Cfang, asin = CFrame.new, CFrame.Angles, math.asin
- game:GetService("RunService").RenderStepped:Connect(function()
- local cameraDirection = root.CFrame:toObjectSpace(camera.CFrame).lookVector
- if neck then
- neck.C0 = Cframe(0, yset, 0) * Cfang(0, -asin(cameraDirection.x), 0) * Cfang(asin(cameraDirection.y), 0, 0)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment