New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How can I attach camera to players head?

Asked by 9 days 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 9 days 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 — 9d
Ad

Answer this question