How do I make the camera face the NPC?

I am making a dialog system for my game and I want the camera to face the front of the NPC. The problem is, it doesn’t work for every rotation as shown here.

Here everything works fine:

But when the NPC is rotated the NPC the camera doesn’t rotate with it

Here is the code for the camera manipulation:

	local tween = TS:Create(camera,info,{
		CFrame = CFrame.new(guipart.Orientation.X,guipart.Position.Y,guipart.Orientation.Z+5),
		Focus = CFrame.new(guipart.Position.X, guipart.Position.Y+1, guipart.Position.Z+4.5)
	})
	tween:Play()

Thanks for reading! :happy3:

1 Like

Try this

local target = guipart.CFrame
local cf = target + (target.lookVector * 5)
local focus = target + (target.lookVector * 4.5) 

Let me know if it works.