hello. I want to make the camera focus on the NPC's head. How to make this
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
Closed as Not Constructive by brokenVectors and Amiaa16
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?