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

How to focus camera at npc head?

hello. I want to make the camera focus on the NPC's head. How to make this

3 comments

0

Do you mean like face the NPC?

0

focus camera at head, i need this in the dialogue

0

Do you want it to look at the npc's head or move to it altogether?

1 answer

✓ Accepted answer

in a local script :

local CF = workspace.Camera.CFrame
workspace.Camera.CameraSubject = workspace.NPC.Head
workspace.Camera.CFrame = workspace.NPC.Head.CFrame + workspace.NPC.Head.CFrame.LookVector * 2  
workspace.Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0))
workspace.Camera.CameraType = "Scriptable"
wait(5) --Time until the camera focus the player
workspace.Camera.CameraType = "Custom"
local player = game.Players.LocalPlayer
workspace.Camera.CameraSubject = workspace[player.Name].Humanoid
workspace.Camera.CFrame = CF --place the camera in its old position

to copy and paste:

local CF = workspace.Camera.CFrame workspace.Camera.CameraSubject = workspace.NPC.Head workspace.Camera.CFrame = workspace.NPC.Head.CFrame + workspace.NPC.Head.CFrame.LookVector * 2
workspace.Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0)) workspace.Camera.CameraType = "Scriptable" wait(5) --Time until the camera focus the player workspace.Camera.CameraType = "Custom" local player = game.Players.LocalPlayer workspace.Camera.CameraSubject = workspace[player.Name].Humanoid workspace.Camera.CFrame = CF --place the camera in its old position

1 comment

1

what

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