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

How to focus camera at npc head? [closed]

Asked by 4 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

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

0
Do you mean like face the NPC? Xx0966xX 41 — 4y
0
focus camera at head, i need this in the dialogue RangerZafon -12 — 4y
0
Do you want it to look at the npc's head or move to it altogether? Amiaa16 3227 — 4y

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?

1 answer

Log in to vote
0
Answered by
gs_115 11
4 years ago

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
what brokenVectors 525 — 4y
Ad