Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I attach camera to players head?

Asked by 4 years ago

How can I attach the camera to the players head? I have a script that makes the players head move up and down with the torso and I want the camera to follow with the head and torso.

1 answer

Log in to vote
0
Answered by 4 years ago
game:GetService("RunService").RenderStepped:Connect(function()
    local TweenService = game:GetService("TweenService")
    local tween = TweenService:Create(workspace.CurrentCamera, TweenInfo.new(0, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), {CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.CFrame)})
    tween:Play()
end)
0
Thanks for responding! I put this script in a local script and i get an error that says "14:55:25.638 - Workspace.1mastermind.Script.LocalScript:3: bad argument #1 (Vector3 expected, got CFrame)" On line 3 of the code you gave. 1mastermind 3 — 4y
Ad

Answer this question