I am a new coder, I want the player’s camera to position and orient itself relative to the NPC’s rotation like the image below:
My current code does not account for the NPC’s rotation in it, and I know there is a simple fix but I can’t figure it out:
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
local Facing = NPC_HRP.CFrame.Rotation * CFrame.Angles(0, math.rad(-90), 0)
Camera.CFrame = CFrame.new(NPC_HRP.Position.X -10, NPC_HRP.Position.Y+ 2, NPC_HRP.Position.Z - 6) * Facing
end)