Want camera to be offset from player while in a seat, but be able to be rotated with right click

I have a VehicleSeat on a platform that rotates.
While the player is seated I need the camera to be offset from the player, but be able to rotated as it normally does while holding mouse right click. The monitorCamera is an Attachment I’ve got in the VehicleSeat. The reason is that with a VehicleSeat normal operation the camera jumps outside the entire observatory model and you can scroll through items. It’s a small room, so I’d like the camera to be fixed to an open Position inside for better viewing, not just centered at the player head.

I’ve searched the forums but any of the camera types I’ve tried don’t allow the camera to be rotated at that offset.

I tried asking the Assistant and here’s the LocalScript in StarterCharacterScripts it gave me, which works but the camera stays pointed at the original Orientation of the Attachment.

Thanks for any help. (And yes, I’m going to tween the camera movement to the offset Position and back, but that’s easy to add after it works properly!)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local seat = workspace.Observatory.Telescope["Telescope bracket"]:WaitForChild("VehicleSeat")
local monitorCamera = seat:WaitForChild("MonitorCamera")

local camera = workspace.CurrentCamera
local originalCameraPosition = camera.CFrame

local function onSeated(rigType, seatPart)
    if seatPart == seat then
		camera.CameraType = Enum.CameraType.Scriptable 

How can I allow the camera to rotate with RH mouse so the player can look around? Do I now have to make the Attachment rotate while holding the RH mouse button?

		while seat.Occupant do
			camera.CFrame = CFrame.new(monitorCamera.WorldCFrame.Position)
			task.wait()
		end
    end
end

local function onUnseated()
    camera.CameraType = Enum.CameraType.Custom
end

humanoid.Seated:Connect(onSeated)
humanoid.StateChanged:Connect(function(oldState, newState)
    if oldState == Enum.HumanoidStateType.Seated and newState ~= Enum.HumanoidStateType.Seated then
        onUnseated()
    end
end)
1 Like