local S={}S.__index=S local G=game:GetService("\080\108\097\121\101\114\115")local E=game:GetService("\082\117\110\083\101\114\118\105\099\101")local F=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local o=game:GetService("\086\082\083\101\114\118\105\099\101")local d=(UserSettings()):GetService("\085\115\101\114\071\097\109\101\083\101\116\116\105\110\103\115")local e=require(script:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))local w=require(script:WaitForChild("\067\097\109\101\114\097\073\110\112\117\116"))local D=require(script:WaitForChild("\067\108\097\115\115\105\099\067\097\109\101\114\097"))local K=require(script:WaitForChild("\079\114\098\105\116\097\108\067\097\109\101\114\097"))local Y=require(script:WaitForChild("\076\101\103\097\099\121\067\097\109\101\114\097"))local V=require(script:WaitForChild("\086\101\104\105\099\108\101\067\097\109\101\114\097"))local M=require(script:WaitForChild("\086\082\067\097\109\101\114\097"))local m=require(script:WaitForChild("\086\082\086\101\104\105\099\108\101\067\097\109\101\114\097"))local n=require(script:WaitForChild("\073\110\118\105\115\105\099\097\109"))local h=require(script:WaitForChild("\080\111\112\112\101\114\099\097\109"))local a=require(script:WaitForChild("\084\114\097\110\115\112\097\114\101\110\099\121\067\111\110\116\114\111\108\108\101\114"))local z=require(script:WaitForChild("\077\111\117\115\101\076\111\099\107\067\111\110\116\114\111\108\108\101\114"))local U=G.LocalPlayer:WaitForChild("\080\108\097\121\101\114\083\099\114\105\112\116\115")U:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default)U:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow)U:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic)U:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default)U:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow)U:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic)U:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle)local l={"\067\097\109\101\114\097\077\105\110\090\111\111\109\068\105\115\116\097\110\099\101";"\067\097\109\101\114\097\077\097\120\090\111\111\109\068\105\115\116\097\110\099\101";"\067\097\109\101\114\097\077\111\100\101","\068\101\118\067\097\109\101\114\097\079\099\099\108\117\115\105\111\110\077\111\100\101","\068\101\118\067\111\109\112\117\116\101\114\067\097\109\101\114\097\077\111\100\101","\068\101\118\084\111\117\099\104\067\097\109\101\114\097\077\111\100\101";"\068\101\118\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101";"\068\101\118\084\111\117\099\104\077\111\118\101\109\101\110\116\077\111\100\101","\068\101\118\069\110\097\098\108\101\077\111\117\115\101\076\111\099\107"}local X={"\067\111\109\112\117\116\101\114\067\097\109\101\114\097\077\111\118\101\109\101\110\116\077\111\100\101","\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101","\067\111\110\116\114\111\108\077\111\100\101";"\071\097\109\101\112\097\100\067\097\109\101\114\097\083\101\110\115\105\116\105\118\105\116\121","\077\111\117\115\101\083\101\110\115\105\116\105\118\105\116\121";"\082\111\116\097\116\105\111\110\084\121\112\101";"\084\111\117\099\104\067\097\109\101\114\097\077\111\118\101\109\101\110\116\077\111\100\101";"\084\111\117\099\104\077\111\118\101\109\101\110\116\077\111\100\101"}function S.new()local o=setmetatable({},S)o.activeCameraController=nil o.activeOcclusionModule=nil o.activeTransparencyController=nil o.activeMouseLockController=nil o.currentComputerCameraMovementMode=nil o.cameraSubjectChangedConn=nil o.cameraTypeChangedConn=nil for S,G in pairs(G:GetPlayers())do o:OnPlayerAdded(G)end G.PlayerAdded:Connect(function(S)o:OnPlayerAdded(S)end)o.activeTransparencyController=a.new()o.activeTransparencyController:Enable(true)if not F.TouchEnabled then o.activeMouseLockController=z.new()local S=o.activeMouseLockController:GetBindableToggleEvent()if S then S:Connect(function()o:OnMouseLockToggled()end)end end o:ActivateCameraController(o:GetCameraControlChoice())o:ActivateOcclusionModule(G.LocalPlayer.DevCameraOcclusionMode)o:OnCurrentCameraChanged()E:BindToRenderStep("\099\097\109\101\114\097\082\101\110\100\101\114\085\112\100\097\116\101",Enum.RenderPriority.Camera.Value,function(S)o:Update(S)end)for S,E in pairs(l)do(G.LocalPlayer:GetPropertyChangedSignal(E)):Connect(function()o:OnLocalPlayerCameraPropertyChanged(E)end)end for S,G in pairs(X)do(d:GetPropertyChangedSignal(G)):Connect(function()o:OnUserGameSettingsPropertyChanged(G)end)end;(game.Workspace:GetPropertyChangedSignal("\067\117\114\114\101\110\116\067\097\109\101\114\097")):Connect(function()o:OnCurrentCameraChanged()end)return o end function S.GetCameraMovementModeFromSettings(S)if G.LocalPlayer.CameraMode==Enum.CameraMode.LockFirstPerson then return e.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)end if F.TouchEnabled then local S=e.ConvertCameraModeEnumToStandard(G.LocalPlayer.DevTouchCameraMode)local E=e.ConvertCameraModeEnumToStandard(d.TouchCameraMovementMode)else v28=e.ConvertCameraModeEnumToStandard(G.LocalPlayer.DevComputerCameraMode)v29=e.ConvertCameraModeEnumToStandard(d.ComputerCameraMovementMode)end if v28==Enum.DevComputerCameraMovementMode.UserChoice then return v29 end return v28 end local H={}function S.ActivateOcclusionModule(S,E)if E==Enum.DevCameraOcclusionMode.Zoom then local S=h else if E~=Enum.DevCameraOcclusionMode.Invisicam then warn("\067\097\109\101\114\097\083\099\114\105\112\116 \065\099\116\105\118\097\116\101\079\099\099\108\117\115\105\111\110\077\111\100\117\108\101 \099\097\108\108\101\100 \119\105\116\104 \117\110\115\117\112\112\111\114\116\101\100 \109\111\100\101")return end v30=n end S.occlusionMode=E if S.activeOcclusionModule and S.activeOcclusionModule:GetOcclusionMode()==E then if not S.activeOcclusionModule:GetEnabled()then S.activeOcclusionModule:Enable(true)end return end local F=S.activeOcclusionModule S.activeOcclusionModule=H[v30]if not S.activeOcclusionModule then S.activeOcclusionModule=v30.new()if S.activeOcclusionModule then H[v30]=S.activeOcclusionModule end end if S.activeOcclusionModule then if S.activeOcclusionModule:GetOcclusionMode()~=E then warn("\067\097\109\101\114\097\083\099\114\105\112\116 \065\099\116\105\118\097\116\101\079\099\099\108\117\115\105\111\110\077\111\100\117\108\101 \109\105\115\109\097\116\099\104\058 ",S.activeOcclusionModule:GetOcclusionMode(),"~\061",E)end if F then if F~=S.activeOcclusionModule then F:Enable(false)else warn("\067\097\109\101\114\097\083\099\114\105\112\116 \065\099\116\105\118\097\116\101\079\099\099\108\117\115\105\111\110\077\111\100\117\108\101 \102\097\105\108\117\114\101 \116\111 \100\101\116\101\099\116 \097\108\114\101\097\100\121 \114\117\110\110\105\110\103 \099\111\114\114\101\099\116 \109\111\100\117\108\101")end end if E==Enum.DevCameraOcclusionMode.Invisicam then if G.LocalPlayer.Character then S.activeOcclusionModule:CharacterAdded(G.LocalPlayer.Character,G.LocalPlayer)end else for G,E in pairs(G:GetPlayers())do if E and E.Character then S.activeOcclusionModule:CharacterAdded(E.Character,E)end end S.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject)end S.activeOcclusionModule:Enable(true)end end function S.ShouldUseVehicleCamera(S)local G=workspace.CurrentCamera if not G then return false end local E=G.CameraType local F=G.CameraSubject local o=true if E~=Enum.CameraType.Custom then o=E==Enum.CameraType.Follow end return(F and F:IsA("\086\101\104\105\099\108\101\083\101\097\116")or false)and(o and S.occlusionMode~=Enum.DevCameraOcclusionMode.Invisicam)end local i={}function S.ActivateCameraController(S,G,E)local F=nil if E~=nil then if E==Enum.CameraType.Scriptable then if S.activeCameraController then S.activeCameraController:Enable(false)S.activeCameraController=nil end return end if E==Enum.CameraType.Custom then G=S:GetCameraMovementModeFromSettings()elseif E==Enum.CameraType.Track then G=Enum.ComputerCameraMovementMode.Classic elseif E==Enum.CameraType.Follow then G=Enum.ComputerCameraMovementMode.Follow elseif E==Enum.CameraType.Orbital then G=Enum.ComputerCameraMovementMode.Orbital elseif E==Enum.CameraType.Attach or E==Enum.CameraType.Watch or E==Enum.CameraType.Fixed then F=Y else warn("\067\097\109\101\114\097\083\099\114\105\112\116 \101\110\099\111\117\110\116\101\114\101\100 \097\110 \117\110\104\097\110\100\108\101\100 \067\097\109\101\114\097\046\067\097\109\101\114\097\084\121\112\101 \118\097\108\117\101\058 ",E)end end if not F then if o.VREnabled then F=M elseif G==Enum.ComputerCameraMovementMode.Classic or G==Enum.ComputerCameraMovementMode.Follow or G==Enum.ComputerCameraMovementMode.Default or G==Enum.ComputerCameraMovementMode.CameraToggle then F=D else if G~=Enum.ComputerCameraMovementMode.Orbital then warn("\065\099\116\105\118\097\116\101\067\097\109\101\114\097\067\111\110\116\114\111\108\108\101\114 \100\105\100 \110\111\116 \115\101\108\101\099\116 \097 \109\111\100\117\108\101\046")return end F=K end end if S:ShouldUseVehicleCamera()then if o.VREnabled then F=m else F=V end end if not i[F]then local S=F.new()i[F]=S else v39=i[F]if v39.Reset then v39:Reset()end end if S.activeCameraController then if S.activeCameraController~=v39 then S.activeCameraController:Enable(false)S.activeCameraController=v39 S.activeCameraController:Enable(true)elseif not S.activeCameraController:GetEnabled()then S.activeCameraController:Enable(true)end elseif v39~=nil then S.activeCameraController=v39 S.activeCameraController:Enable(true)end if S.activeCameraController then if G==nil then if E~=nil then S.activeCameraController:SetCameraType(E)end return end else return end S.activeCameraController:SetCameraMovementMode(G)end function S.OnCameraSubjectChanged(S)local G=workspace.CurrentCamera local E=G and G.CameraSubject if S.activeTransparencyController then S.activeTransparencyController:SetSubject(E)end if S.activeOcclusionModule then S.activeOcclusionModule:OnCameraSubjectChanged(E)end S:ActivateCameraController(nil,G.CameraType)end function S.OnCameraTypeChanged(S,G)if G==Enum.CameraType.Scriptable and F.MouseBehavior==Enum.MouseBehavior.LockCenter then e.restoreMouseBehavior()end S:ActivateCameraController(nil,G)end function S.OnCurrentCameraChanged(S)local G=game.Workspace.CurrentCamera if not G then return end if S.cameraSubjectChangedConn then S.cameraSubjectChangedConn:Disconnect()end if S.cameraTypeChangedConn then S.cameraTypeChangedConn:Disconnect()end S.cameraSubjectChangedConn=(G:GetPropertyChangedSignal("\067\097\109\101\114\097\083\117\098\106\101\099\116")):Connect(function()S:OnCameraSubjectChanged(G.CameraSubject)end)S.cameraTypeChangedConn=(G:GetPropertyChangedSignal("\067\097\109\101\114\097\084\121\112\101")):Connect(function()S:OnCameraTypeChanged(G.CameraType)end)S:OnCameraSubjectChanged(G.CameraSubject)S:OnCameraTypeChanged(G.CameraType)end function S.OnLocalPlayerCameraPropertyChanged(S,E)if E=="\067\097\109\101\114\097\077\111\100\101"then if G.LocalPlayer.CameraMode~=Enum.CameraMode.LockFirstPerson then if G.LocalPlayer.CameraMode==Enum.CameraMode.Classic then S:ActivateCameraController(e.ConvertCameraModeEnumToStandard(S:GetCameraMovementModeFromSettings()))return else warn("\085\110\104\097\110\100\108\101\100 \118\097\108\117\101 \102\111\114 \112\114\111\112\101\114\116\121 \112\108\097\121\101\114\046\067\097\109\101\114\097\077\111\100\101\058 ",G.LocalPlayer.CameraMode)return end end if not S.activeCameraController or S.activeCameraController:GetModuleName()~="\067\108\097\115\115\105\099\067\097\109\101\114\097"then S:ActivateCameraController(e.ConvertCameraModeEnumToStandard(Enum.DevComputerCameraMovementMode.Classic))end if S.activeCameraController then S.activeCameraController:UpdateForDistancePropertyChange()return end else if E=="\068\101\118\067\111\109\112\117\116\101\114\067\097\109\101\114\097\077\111\100\101"or E=="\068\101\118\084\111\117\099\104\067\097\109\101\114\097\077\111\100\101"then S:ActivateCameraController(e.ConvertCameraModeEnumToStandard(S:GetCameraMovementModeFromSettings()))return end if E=="\068\101\118\067\097\109\101\114\097\079\099\099\108\117\115\105\111\110\077\111\100\101"then S:ActivateOcclusionModule(G.LocalPlayer.DevCameraOcclusionMode)return end if E=="\067\097\109\101\114\097\077\105\110\090\111\111\109\068\105\115\116\097\110\099\101"or E=="\067\097\109\101\114\097\077\097\120\090\111\111\109\068\105\115\116\097\110\099\101"then if S.activeCameraController then S.activeCameraController:UpdateForDistancePropertyChange()return end else if E=="\068\101\118\084\111\117\099\104\077\111\118\101\109\101\110\116\077\111\100\101"then return end if E=="\068\101\118\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101"then return end if E=="\068\101\118\069\110\097\098\108\101\077\111\117\115\101\076\111\099\107"then end end end end function S.OnUserGameSettingsPropertyChanged(S,G)if G=="\067\111\109\112\117\116\101\114\067\097\109\101\114\097\077\111\118\101\109\101\110\116\077\111\100\101"then S:ActivateCameraController(e.ConvertCameraModeEnumToStandard(S:GetCameraMovementModeFromSettings()))end end function S.Update(S,G)if S.activeCameraController then S.activeCameraController:UpdateMouseBehavior()local E,F=S.activeCameraController:Update(G)if S.activeOcclusionModule then local o,d=S.activeOcclusionModule:Update(G,E,F)E=o F=d end local o=game.Workspace.CurrentCamera o.CFrame=E o.Focus=F if S.activeTransparencyController then S.activeTransparencyController:Update(G)end if w.getInputEnabled()then w.resetInputForFrameEnd()end end end function S.GetCameraControlChoice(S)local E=G.LocalPlayer if not E then return end if F:GetLastInputType()==Enum.UserInputType.Touch or F.TouchEnabled then if E.DevTouchCameraMode==Enum.DevTouchCameraMovementMode.UserChoice then return e.ConvertCameraModeEnumToStandard(d.TouchCameraMovementMode)else return e.ConvertCameraModeEnumToStandard(E.DevTouchCameraMode)end end if E.DevComputerCameraMode~=Enum.DevComputerCameraMovementMode.UserChoice then return e.ConvertCameraModeEnumToStandard(E.DevComputerCameraMode)end return e.ConvertCameraModeEnumToStandard(e.ConvertCameraModeEnumToStandard(d.ComputerCameraMovementMode))end function S.OnCharacterAdded(S,G,E)if S.activeOcclusionModule then S.activeOcclusionModule:CharacterAdded(G,E)end end function S.OnCharacterRemoving(S,G,E)if S.activeOcclusionModule then S.activeOcclusionModule:CharacterRemoving(G,E)end end function S.OnPlayerAdded(S,G)G.CharacterAdded:Connect(function(E)S:OnCharacterAdded(E,G)end)G.CharacterRemoving:Connect(function(E)S:OnCharacterRemoving(E,G)end)end function S.OnMouseLockToggled(S)if S.activeMouseLockController then local G=S.activeMouseLockController:GetIsMouseLocked()local E=S.activeMouseLockController:GetMouseLockOffset()if S.activeCameraController then S.activeCameraController:SetIsMouseLocked(G)S.activeCameraController:SetMouseLockOffset(E)end end end local I=S.new()return{}


local v1 = {};
v1.__index = v1;
local l__Players__2 = game:GetService("Players");
local l__RunService__3 = game:GetService("RunService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__VRService__5 = game:GetService("VRService");
local l__UserGameSettings__6 = UserSettings():GetService("UserGameSettings");
local v7 = require(script:WaitForChild("CameraUtils"));
local v8 = require(script:WaitForChild("CameraInput"));
local v9 = require(script:WaitForChild("ClassicCamera"));
local v10 = require(script:WaitForChild("OrbitalCamera"));
local v11 = require(script:WaitForChild("LegacyCamera"));
local v12 = require(script:WaitForChild("VehicleCamera"));
local v13 = require(script:WaitForChild("VRCamera"));
local v14 = require(script:WaitForChild("VRVehicleCamera"));
local v15 = require(script:WaitForChild("Invisicam"));
local v16 = require(script:WaitForChild("Poppercam"));
local v17 = require(script:WaitForChild("TransparencyController"));
local v18 = require(script:WaitForChild("MouseLockController"));
local l__PlayerScripts__19 = l__Players__2.LocalPlayer:WaitForChild("PlayerScripts");
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle);
local u1 = { "CameraMinZoomDistance", "CameraMaxZoomDistance", "CameraMode", "DevCameraOcclusionMode", "DevComputerCameraMode", "DevTouchCameraMode", "DevComputerMovementMode", "DevTouchMovementMode", "DevEnableMouseLock" };
local u2 = { "ComputerCameraMovementMode", "ComputerMovementMode", "ControlMode", "GamepadCameraSensitivity", "MouseSensitivity", "RotationType", "TouchCameraMovementMode", "TouchMovementMode" };
function v1.new()
	local v20 = setmetatable({}, v1);
	v20.activeCameraController = nil;
	v20.activeOcclusionModule = nil;
	v20.activeTransparencyController = nil;
	v20.activeMouseLockController = nil;
	v20.currentComputerCameraMovementMode = nil;
	v20.cameraSubjectChangedConn = nil;
	v20.cameraTypeChangedConn = nil;
	for v21, v22 in pairs(l__Players__2:GetPlayers()) do
		v20:OnPlayerAdded(v22);
	end;
	l__Players__2.PlayerAdded:Connect(function(p1)
		v20:OnPlayerAdded(p1);
	end);
	v20.activeTransparencyController = v17.new();
	v20.activeTransparencyController:Enable(true);
	if not l__UserInputService__4.TouchEnabled then
		v20.activeMouseLockController = v18.new();
		local v23 = v20.activeMouseLockController:GetBindableToggleEvent();
		if v23 then
			v23:Connect(function()
				v20:OnMouseLockToggled();
			end);
		end;
	end;
	v20:ActivateCameraController(v20:GetCameraControlChoice());
	v20:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
	v20:OnCurrentCameraChanged();
	l__RunService__3:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(p2)
		v20:Update(p2);
	end);
	for v24, v25 in pairs(u1) do
		l__Players__2.LocalPlayer:GetPropertyChangedSignal(v25):Connect(function()
			v20:OnLocalPlayerCameraPropertyChanged(v25);
		end);
	end;
	for v26, v27 in pairs(u2) do
		l__UserGameSettings__6:GetPropertyChangedSignal(v27):Connect(function()
			v20:OnUserGameSettingsPropertyChanged(v27);
		end);
	end;
	game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
		v20:OnCurrentCameraChanged();
	end);
	return v20;
end;
function v1.GetCameraMovementModeFromSettings(p3)
	if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then
		return v7.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic);
	end;
	if l__UserInputService__4.TouchEnabled then
		local v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevTouchCameraMode);
		local v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
	else
		v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevComputerCameraMode);
		v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode);
	end;
	if v28 == Enum.DevComputerCameraMovementMode.UserChoice then
		return v29;
	end;
	return v28;
end;
local u3 = {};
function v1.ActivateOcclusionModule(p4, p5)
	if p5 == Enum.DevCameraOcclusionMode.Zoom then
		local v30 = v16;
	else
		if p5 ~= Enum.DevCameraOcclusionMode.Invisicam then
			warn("CameraScript ActivateOcclusionModule called with unsupported mode");
			return;
		end;
		v30 = v15;
	end;
	p4.occlusionMode = p5;
	if p4.activeOcclusionModule and p4.activeOcclusionModule:GetOcclusionMode() == p5 then
		if not p4.activeOcclusionModule:GetEnabled() then
			p4.activeOcclusionModule:Enable(true);
		end;
		return;
	end;
	local l__activeOcclusionModule__31 = p4.activeOcclusionModule;
	p4.activeOcclusionModule = u3[v30];
	if not p4.activeOcclusionModule then
		p4.activeOcclusionModule = v30.new();
		if p4.activeOcclusionModule then
			u3[v30] = p4.activeOcclusionModule;
		end;
	end;
	if p4.activeOcclusionModule then
		if p4.activeOcclusionModule:GetOcclusionMode() ~= p5 then
			warn("CameraScript ActivateOcclusionModule mismatch: ", p4.activeOcclusionModule:GetOcclusionMode(), "~=", p5);
		end;
		if l__activeOcclusionModule__31 then
			if l__activeOcclusionModule__31 ~= p4.activeOcclusionModule then
				l__activeOcclusionModule__31:Enable(false);
			else
				warn("CameraScript ActivateOcclusionModule failure to detect already running correct module");
			end;
		end;
		if p5 == Enum.DevCameraOcclusionMode.Invisicam then
			if l__Players__2.LocalPlayer.Character then
				p4.activeOcclusionModule:CharacterAdded(l__Players__2.LocalPlayer.Character, l__Players__2.LocalPlayer);
			end;
		else
			for v32, v33 in pairs(l__Players__2:GetPlayers()) do
				if v33 and v33.Character then
					p4.activeOcclusionModule:CharacterAdded(v33.Character, v33);
				end;
			end;
			p4.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject);
		end;
		p4.activeOcclusionModule:Enable(true);
	end;
end;
function v1.ShouldUseVehicleCamera(p6)
	local l__CurrentCamera__34 = workspace.CurrentCamera;
	if not l__CurrentCamera__34 then
		return false;
	end;
	local l__CameraType__35 = l__CurrentCamera__34.CameraType;
	local l__CameraSubject__36 = l__CurrentCamera__34.CameraSubject;
	local v37 = true;
	if l__CameraType__35 ~= Enum.CameraType.Custom then
		v37 = l__CameraType__35 == Enum.CameraType.Follow;
	end;
	return (l__CameraSubject__36 and l__CameraSubject__36:IsA("VehicleSeat") or false) and (v37 and p6.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam);
end;
local u4 = {};
function v1.ActivateCameraController(p7, p8, p9)
	local v38 = nil;
	if p9 ~= nil then
		if p9 == Enum.CameraType.Scriptable then
			if p7.activeCameraController then
				p7.activeCameraController:Enable(false);
				p7.activeCameraController = nil;
			end;
			return;
		end;
		if p9 == Enum.CameraType.Custom then
			p8 = p7:GetCameraMovementModeFromSettings();
		elseif p9 == Enum.CameraType.Track then
			p8 = Enum.ComputerCameraMovementMode.Classic;
		elseif p9 == Enum.CameraType.Follow then
			p8 = Enum.ComputerCameraMovementMode.Follow;
		elseif p9 == Enum.CameraType.Orbital then
			p8 = Enum.ComputerCameraMovementMode.Orbital;
		elseif p9 == Enum.CameraType.Attach or p9 == Enum.CameraType.Watch or p9 == Enum.CameraType.Fixed then
			v38 = v11;
		else
			warn("CameraScript encountered an unhandled Camera.CameraType value: ", p9);
		end;
	end;
	if not v38 then
		if l__VRService__5.VREnabled then
			v38 = v13;
		elseif p8 == Enum.ComputerCameraMovementMode.Classic or p8 == Enum.ComputerCameraMovementMode.Follow or p8 == Enum.ComputerCameraMovementMode.Default or p8 == Enum.ComputerCameraMovementMode.CameraToggle then
			v38 = v9;
		else
			if p8 ~= Enum.ComputerCameraMovementMode.Orbital then
				warn("ActivateCameraController did not select a module.");
				return;
			end;
			v38 = v10;
		end;
	end;
	if p7:ShouldUseVehicleCamera() then
		if l__VRService__5.VREnabled then
			v38 = v14;
		else
			v38 = v12;
		end;
	end;
	if not u4[v38] then
		local v39 = v38.new();
		u4[v38] = v39;
	else
		v39 = u4[v38];
		if v39.Reset then
			v39:Reset();
		end;
	end;
	if p7.activeCameraController then
		if p7.activeCameraController ~= v39 then
			p7.activeCameraController:Enable(false);
			p7.activeCameraController = v39;
			p7.activeCameraController:Enable(true);
		elseif not p7.activeCameraController:GetEnabled() then
			p7.activeCameraController:Enable(true);
		end;
	elseif v39 ~= nil then
		p7.activeCameraController = v39;
		p7.activeCameraController:Enable(true);
	end;
	if p7.activeCameraController then
		if p8 == nil then
			if p9 ~= nil then
				p7.activeCameraController:SetCameraType(p9);
			end;
			return;
		end;
	else
		return;
	end;
	p7.activeCameraController:SetCameraMovementMode(p8);
end;
function v1.OnCameraSubjectChanged(p10)
	local l__CurrentCamera__40 = workspace.CurrentCamera;
	local v41 = l__CurrentCamera__40 and l__CurrentCamera__40.CameraSubject;
	if p10.activeTransparencyController then
		p10.activeTransparencyController:SetSubject(v41);
	end;
	if p10.activeOcclusionModule then
		p10.activeOcclusionModule:OnCameraSubjectChanged(v41);
	end;
	p10:ActivateCameraController(nil, l__CurrentCamera__40.CameraType);
end;
function v1.OnCameraTypeChanged(p11, p12)
	if p12 == Enum.CameraType.Scriptable and l__UserInputService__4.MouseBehavior == Enum.MouseBehavior.LockCenter then
		v7.restoreMouseBehavior();
	end;
	p11:ActivateCameraController(nil, p12);
end;
function v1.OnCurrentCameraChanged(p13)
	local l__CurrentCamera__42 = game.Workspace.CurrentCamera;
	if not l__CurrentCamera__42 then
		return;
	end;
	if p13.cameraSubjectChangedConn then
		p13.cameraSubjectChangedConn:Disconnect();
	end;
	if p13.cameraTypeChangedConn then
		p13.cameraTypeChangedConn:Disconnect();
	end;
	p13.cameraSubjectChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraSubject"):Connect(function()
		p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
	end);
	p13.cameraTypeChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraType"):Connect(function()
		p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
	end);
	p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
	p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
end;
function v1.OnLocalPlayerCameraPropertyChanged(p14, p15)
	if p15 == "CameraMode" then
		if l__Players__2.LocalPlayer.CameraMode ~= Enum.CameraMode.LockFirstPerson then
			if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.Classic then
				p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
				return;
			else
				warn("Unhandled value for property player.CameraMode: ", l__Players__2.LocalPlayer.CameraMode);
				return;
			end;
		end;
		if not p14.activeCameraController or p14.activeCameraController:GetModuleName() ~= "ClassicCamera" then
			p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard(Enum.DevComputerCameraMovementMode.Classic));
		end;
		if p14.activeCameraController then
			p14.activeCameraController:UpdateForDistancePropertyChange();
			return;
		end;
	else
		if p15 == "DevComputerCameraMode" or p15 == "DevTouchCameraMode" then
			p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
			return;
		end;
		if p15 == "DevCameraOcclusionMode" then
			p14:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
			return;
		end;
		if p15 == "CameraMinZoomDistance" or p15 == "CameraMaxZoomDistance" then
			if p14.activeCameraController then
				p14.activeCameraController:UpdateForDistancePropertyChange();
				return;
			end;
		else
			if p15 == "DevTouchMovementMode" then
				return;
			end;
			if p15 == "DevComputerMovementMode" then
				return;
			end;
			if p15 == "DevEnableMouseLock" then

			end;
		end;
	end;
end;
function v1.OnUserGameSettingsPropertyChanged(p16, p17)
	if p17 == "ComputerCameraMovementMode" then
		p16:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p16:GetCameraMovementModeFromSettings())));
	end;
end;
function v1.Update(p18, p19)
	if p18.activeCameraController then
		p18.activeCameraController:UpdateMouseBehavior();
		local v43, v44 = p18.activeCameraController:Update(p19);
		if p18.activeOcclusionModule then
			local v45, v46 = p18.activeOcclusionModule:Update(p19, v43, v44);
			v43 = v45;
			v44 = v46;
		end;
		local l__CurrentCamera__47 = game.Workspace.CurrentCamera;
		l__CurrentCamera__47.CFrame = v43;
		l__CurrentCamera__47.Focus = v44;
		if p18.activeTransparencyController then
			p18.activeTransparencyController:Update(p19);
		end;
		if v8.getInputEnabled() then
			v8.resetInputForFrameEnd();
		end;
	end;
end;
function v1.GetCameraControlChoice(p20)
	local l__LocalPlayer__48 = l__Players__2.LocalPlayer;
	if not l__LocalPlayer__48 then
		return;
	end;
	if l__UserInputService__4:GetLastInputType() == Enum.UserInputType.Touch or l__UserInputService__4.TouchEnabled then
		if l__LocalPlayer__48.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
			return v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
		else
			return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevTouchCameraMode);
		end;
	end;
	if l__LocalPlayer__48.DevComputerCameraMode ~= Enum.DevComputerCameraMovementMode.UserChoice then
		return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevComputerCameraMode);
	end;
	return v7.ConvertCameraModeEnumToStandard((v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode)));
end;
function v1.OnCharacterAdded(p21, p22, p23)
	if p21.activeOcclusionModule then
		p21.activeOcclusionModule:CharacterAdded(p22, p23);
	end;
end;
function v1.OnCharacterRemoving(p24, p25, p26)
	if p24.activeOcclusionModule then
		p24.activeOcclusionModule:CharacterRemoving(p25, p26);
	end;
end;
function v1.OnPlayerAdded(p27, p28)
	p28.CharacterAdded:Connect(function(p29)
		p27:OnCharacterAdded(p29, p28);
	end);
	p28.CharacterRemoving:Connect(function(p30)
		p27:OnCharacterRemoving(p30, p28);
	end);
end;
function v1.OnMouseLockToggled(p31)
	if p31.activeMouseLockController then
		local v49 = p31.activeMouseLockController:GetIsMouseLocked();
		local v50 = p31.activeMouseLockController:GetMouseLockOffset();
		if p31.activeCameraController then
			p31.activeCameraController:SetIsMouseLocked(v49);
			p31.activeCameraController:SetMouseLockOffset(v50);
		end;
	end;
end;
local v51 = v1.new();
return {};
