Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make the camera move with the character's head?

Here was what I had tried:

player = game.Players.LocalPlayer
char = player.Character
camera = workspace.CurrentCamera

game:GetService("RunService").RenderStepped:connect(function()
camera.CFrame = camera.CFrame + Vector3.new(0,char.Head.Position.y,0)
end)

What I was trying to do was make the camera move horizontally with the head.

EX: Character crouches, camera moves down with character's head

6 comments

0

camera.CFrame = camera.CFrame + CFrame.new() not Vector3.new

0

I had already tried that, but thanks for helping. I think I may have found the solution but I have not thought of it yet.

0

Tested it*

0

okay so it didnt work

0

I updated my answer

0

Is your camera scriptable and I don't think local scripts can access Workspace

1 answer

Try this

player = game.Players.LocalPlayer
char = player.Character
camera = workspace.CurrentCamera
camera.CameraType = "Scriptable"

game:GetService("RunService").RenderStepped:Connect(function()
camera.CFrame = CFrame.new(camera.CFrame.X,char.Head.CFrame.Y,camera.CFrame.Z)
end)

3 comments

0

I had already tried that before, the camera just gets stuck.

0

Oh wait, i know your problem

0

I want the camera to follow the player. Go to Flee the Facility and hold shift, you will see the effect I am looking for.

This discussion is preserved as it was. New answers, comments, and votes are closed.