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

How do I make a camera rotate around a character heads so it faces the characters head?

How do I make a camera rotate around a character heads so it faces the characters head.

THe camera is hard to use....

` repeat wait(0.1) until (game.Players.LocalPlayer ~= nil) and (game.Players.LocalPlayer.Character ~= nil) Player = game.Players.LocalPlayer Char = Player.Character

Cam = game.Workspace.CurrentCamera

Cam.CameraType = "Scriptable" Cam.CameraSubject = Char.Humanoid Cam.Focus = Char.Head.CFrame

Cam.CoordinateFrame = Char.Head.CFrame `

1 comment

1

Use the codeblock format(blue Lua icon), please.

1 answer

Have the Camera point at their head, with an offset.

 repeat until (game.Players.LocalPlayer and game.Players.LocalPlayer.Character) or wait() and nil; 

local Player = game.Players.LocalPlayer;
local Char = Player.Character;

local Cam = workspace.CurrentCamera;

Cam.CameraType = "Scriptable";
--// Cam.CameraSubject = Char.Humanoid; (No point, a Scriptable camera prevents this.)
 --// Cam.Focus = Char.Head.CFrame; ( unsettable, lol )

Cam.CoordinateFrame = CFrame.new(Char.Head.CFrame.p,Char.Head.Position)*CFrame.new(0,0,-1);--// Makes it face the head, then back up a little.(1 stud)

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