i need to make a camera manipulation where, when a user sits on a certain seat (there will be multiple of the special seats as it is a vehicle if that helps) it will change there camera to somewhere else. when the user stops sitting it would reset the camera. how would i do this?
my current script that i a trying to make work:
local Player = game.Players.LocalPlayer
local Character = Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Seated:Connect(function(seated, seat)
if seated then
local SeatParent = seat.Parent
if seat.Name == "BoatSeat" then
game:GetService("RunService").RenderStepped:Connect(function()
if seated then
if seat.Name == "BoatSeat" then
workspace.CurrentCamera.CameraType = Enum.C ameraType.Scriptable
workspace.CurrentCamera.CFrame = SeatParent.Camera.CFrame
elseif not seat.Name == "BoatSeat" then
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CFrame = Character.Head.CFrame
end
else
workspace.CurrentCamera.CameraType = Enum.Came raType.Custom
workspace.CurrentCamera.CFrame = Character.Head.CFrame
end
end)
end
end
end)
how would i go into making this work?