I'm basically trying to make the camera face whichever way a part is faced and positioned.
I've managed to get the camera to be positioned where the part is, but I can't figure out how to face the camera in the direction that the part is facing. I tried setting the camera rotation to equal that of the part, but the camera loves to stay focused on my character. I've also tried changing the CameraSubject to that of the part- as well as changing the camera type- with no luck. Any suggestions?
My Code:
camera = game.Workspace.CurrentCamera CamPart = game.Workspace.CamPart position = CamPart.Position rotation = CamPart.Rotation camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = CFrame.new(position, rotation)
Simply set the camera CFrame to the CamPart's CFrame. CFrames carry over rotations.
camera = game.Workspace.CurrentCamera CamPart = game.Workspace.CamPart camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = CamPart.CFrame