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

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

Asked by 6 years ago

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

0
camera.CFrame = camera.CFrame + CFrame.new() not Vector3.new abnotaddable 920 — 6y
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. DevPotatoeAlt -5 — 6y
0
Tested it* DevPotatoeAlt -5 — 6y
0
okay so it didnt work DevPotatoeAlt -5 — 6y
View all comments (2 more)
0
I updated my answer User#17125 0 — 6y
0
Is your camera scriptable and I don't think local scripts can access Workspace saSlol2436 716 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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)
0
I had already tried that before, the camera just gets stuck. DevPotatoeAlt -5 — 6y
0
Oh wait, i know your problem User#17125 0 — 6y
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. DevPotatoeAlt -5 — 6y
Ad

Answer this question