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

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

Asked by 10 years ago

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
Use the codeblock format(blue Lua icon), please. Tesouro 407 — 10y

1 answer

Log in to vote
0
Answered by
Diitto 230 Moderation Voter
10 years ago

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)
Ad

Answer this question