How do I adjust a camera's rotation?

Hey, I’ll keep this as short as possible.
I’m trying to have a camera rotate to an NPC’s head, but it seems like there is no way to do this without using an existing part (which I don’t want to do, to save up a bit of server resources).
I have tried basically everything, and watched like 5 videos, I’m not sure what the right solution here is.

Here is the code:

DialogCamera.CFrame = DialogCamera.CFrame * CFrame.Angles(0,math.rad(CAMERA_ROTATION), 0)

The problem is: you need a Position value for it to work. For some reason, camera’s don’t seem to have that. CFrame.Position doesn’t work either.

Using CFrame.lookAt() doesn’t seem to work either, because the DialogCamera has no Position value.

Thanks a ton in advance for your help.

Is there no other way to do this?

Are you talking about the “Camera” instance or a “Camera Part” because it’s not clear

1 Like

thanks for replying
anywaying, i’m talking about a Camera, not a camerapart

I’m not sure how, but doing the following:

DialogCamera.CFrame = CFrame.new(currentNPC.Head.Position + CameraDistance*(currentNPC.Head.CFrame.lookVector), currentNPC.Head.Position)

has fixed the problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.