First person camera using seat

Hello!

So, I’ve been wondering how to make a first-person camera using seat. Basically, when player is using a seat, their camera becomes first-person.

How would I make this (^) but with a single seat and limits, so player can only rotate their camera by 90 degrees each side?

1 Like
seat = script.Parent.Parent.Seat
function added(child)
    human = child.part1.Parent:FindFirstChild("Humanoid")
player.CameraMode = Enum.CameraMode.LockFirstPerson
seat.ChildAdded:Connect(added)
seat.ChildRemoved:Connect(removed)
1 Like

Well, how would I make the camera follow the cursor?

--// Variables
local cam = workspace.CurrentCamera
local camPart = workspace["CameraPart"]
local mouse = game:GetService("Players").LocalPlayer:GetMouse()

--// Set cam
repeat
      wait()
      cam.CameraType = Enum.CameraType.Scriptable
until
      cam.CameraType == Enum.CameraType.Scriptable

--// Move cam
local maxTilt = 10
game:GetService("RunService").RenderStepped:Connect(function()
      cam.CFrame = camPart.CFrame * CFrame.Angles(
            math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
            math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
            0
      )
end)
2 Likes