local w=Vector3.new(0,0,1)local l={InitialDistance=25,MinDistance=10,MaxDistance=100,InitialElevation=35;MinElevation=35;MaxElevation=35,ReferenceAzimuth=-45;CWAzimuthTravel=90,CCWAzimuthTravel=90,UseAzimuthLimits=false}local R=require(script.Parent:WaitForChild("\066\097\115\101\067\097\109\101\114\097"))local O=setmetatable({},R)O.__index=O function O.new()local w=setmetatable(R.new(),O)w.lastUpdate=tick()w.changedSignalConnections={}w.refAzimuthRad=nil w.curAzimuthRad=nil w.minAzimuthAbsoluteRad=nil w.maxAzimuthAbsoluteRad=nil w.useAzimuthLimits=nil w.curElevationRad=nil w.minElevationRad=nil w.maxElevationRad=nil w.curDistance=nil w.minDistance=nil w.maxDistance=nil w.gamepadDollySpeedMultiplier=1 w.lastUserPanCamera=tick()w.externalProperties={}w.externalProperties.InitialDistance=25 w.externalProperties.MinDistance=10 w.externalProperties.MaxDistance=100 w.externalProperties.InitialElevation=35 w.externalProperties.MinElevation=35 w.externalProperties.MaxElevation=35 w.externalProperties.ReferenceAzimuth=-45 w.externalProperties.CWAzimuthTravel=90 w.externalProperties.CCWAzimuthTravel=90 w.externalProperties.UseAzimuthLimits=false w:LoadNumberValueParameters()return w end function O.LoadOrCreateNumberValueParameter(w,l,R,O)local q=script:FindFirstChild(l)if q and q:isA(R)then w.externalProperties[l]=q.Value else if w.externalProperties[l]==nil then return end q=Instance.new(R)q.Name=l q.Parent=script q.Value=w.externalProperties[l]end if O then if w.changedSignalConnections[l]then w.changedSignalConnections[l]:Disconnect()end w.changedSignalConnections[l]=q.Changed:Connect(function(R)w.externalProperties[l]=R O(w)end)end end function O.SetAndBoundsCheckAzimuthValues(w)w.minAzimuthAbsoluteRad=math.rad(w.externalProperties.ReferenceAzimuth)-math.abs(math.rad(w.externalProperties.CWAzimuthTravel))w.maxAzimuthAbsoluteRad=math.rad(w.externalProperties.ReferenceAzimuth)+math.abs(math.rad(w.externalProperties.CCWAzimuthTravel))w.useAzimuthLimits=w.externalProperties.UseAzimuthLimits if w.useAzimuthLimits then w.curAzimuthRad=math.max(w.curAzimuthRad,w.minAzimuthAbsoluteRad)w.curAzimuthRad=math.min(w.curAzimuthRad,w.maxAzimuthAbsoluteRad)end end function O.SetAndBoundsCheckElevationValues(w)local l=math.max(w.externalProperties.MinElevation,-80)local R=math.min(w.externalProperties.MaxElevation,80)w.minElevationRad=math.rad(math.min(l,R))w.maxElevationRad=math.rad(math.max(l,R))w.curElevationRad=math.max(w.curElevationRad,w.minElevationRad)w.curElevationRad=math.min(w.curElevationRad,w.maxElevationRad)end function O.SetAndBoundsCheckDistanceValues(w)w.minDistance=w.externalProperties.MinDistance w.maxDistance=w.externalProperties.MaxDistance w.curDistance=math.max(w.curDistance,w.minDistance)w.curDistance=math.min(w.curDistance,w.maxDistance)end function O.LoadNumberValueParameters(w)w:LoadOrCreateNumberValueParameter("\073\110\105\116\105\097\108\069\108\101\118\097\116\105\111\110","\078\117\109\098\101\114\086\097\108\117\101",nil)w:LoadOrCreateNumberValueParameter("\073\110\105\116\105\097\108\068\105\115\116\097\110\099\101","\078\117\109\098\101\114\086\097\108\117\101",nil)w:LoadOrCreateNumberValueParameter("\082\101\102\101\114\101\110\099\101\065\122\105\109\117\116\104","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckAzimuthValue)w:LoadOrCreateNumberValueParameter("\067\087\065\122\105\109\117\116\104\084\114\097\118\101\108","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckAzimuthValues)w:LoadOrCreateNumberValueParameter("\067\067\087\065\122\105\109\117\116\104\084\114\097\118\101\108","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckAzimuthValues)w:LoadOrCreateNumberValueParameter("\077\105\110\069\108\101\118\097\116\105\111\110","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckElevationValues)w:LoadOrCreateNumberValueParameter("\077\097\120\069\108\101\118\097\116\105\111\110","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckElevationValues)w:LoadOrCreateNumberValueParameter("\077\105\110\068\105\115\116\097\110\099\101","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckDistanceValues)w:LoadOrCreateNumberValueParameter("\077\097\120\068\105\115\116\097\110\099\101","\078\117\109\098\101\114\086\097\108\117\101",w.SetAndBoundsCheckDistanceValues)w:LoadOrCreateNumberValueParameter("\085\115\101\065\122\105\109\117\116\104\076\105\109\105\116\115","\066\111\111\108\086\097\108\117\101",w.SetAndBoundsCheckAzimuthValues)w.curAzimuthRad=math.rad(w.externalProperties.ReferenceAzimuth)w.curElevationRad=math.rad(w.externalProperties.InitialElevation)w.curDistance=w.externalProperties.InitialDistance w:SetAndBoundsCheckAzimuthValues()w:SetAndBoundsCheckElevationValues()w:SetAndBoundsCheckDistanceValues()end function O.GetModuleName(w)return"\079\114\098\105\116\097\108\067\097\109\101\114\097"end local q=require(script.Parent:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))function O.SetInitialOrientation(w,l)if not l or not l.RootPart then warn("\079\114\098\105\116\097\108\067\097\109\101\114\097 \099\111\117\108\100 \110\111\116 \115\101\116 \105\110\105\116\105\097\108 \111\114\105\101\110\116\097\116\105\111\110 \100\117\101 \116\111 \109\105\115\115\105\110\103 \104\117\109\097\110\111\105\100")return end assert(l.RootPart,"")local R=(l.RootPart.CFrame.LookVector-Vector3.new(0,.23,0)).Unit if not q.IsFinite(q.GetAngleBetweenXZVectors(R,w:GetCameraLookVector()))then end if not q.IsFinite(math.asin((w:GetCameraLookVector()).Y)-math.asin(R.Y))then end end function O.GetCameraToSubjectDistance(w)return w.curDistance end local e=game:GetService("\080\108\097\121\101\114\115")function O.SetCameraToSubjectDistance(w,l)if e.LocalPlayer then w.currentSubjectDistance=math.clamp(l,w.minDistance,w.maxDistance)w.currentSubjectDistance=math.max(w.currentSubjectDistance,w.FIRST_PERSON_DISTANCE_THRESHOLD)end w.inFirstPerson=false w:UpdateMouseBehavior()return w.currentSubjectDistance end local C=Vector3.new(0,0,0)function O.CalculateNewLookVector(w,l,R)local O=l or w:GetCameraLookVector()local q=math.asin(O.Y)local e=Vector2.new(R.X,math.clamp(R.Y,q-1.3962634015955,q-(-1.3962634015955)))return((CFrame.Angles(0,-e.X,0)*CFrame.new(C,O))*CFrame.Angles(-e.Y,0,0)).LookVector end local E=require(script.Parent:WaitForChild("\067\097\109\101\114\097\073\110\112\117\116"))local V=game:GetService("\086\082\083\101\114\118\105\099\101")local a=Vector3.new(1,0,1)local u=2*math.pi function O.Update(l,R)local O=tick()local q=O-l.lastUpdate local C=E.getRotation()~=Vector2.new()local x=workspace.CurrentCamera local z=x.CFrame local Z=x.Focus local d=x and x.CameraSubject local n=d and d:IsA("\086\101\104\105\099\108\101\083\101\097\116")local y=d and d:IsA("\083\107\097\116\101\098\111\097\114\100\080\108\097\116\102\111\114\109")if l.lastUpdate==nil or q>1 then l.lastCameraTransform=nil end if C then l.lastUserPanCamera=tick()end local v=l:GetSubjectPosition()if v and(e.LocalPlayer and x)then if l.gamepadDollySpeedMultiplier~=1 then l:SetCameraToSubjectDistance(l.currentSubjectDistance*l.gamepadDollySpeedMultiplier)end local R=V.VREnabled local O=R and l:GetVRFocus(v,q)or CFrame.new(v)local e=E.getRotation()if R and not l:IsInFirstPerson()then local w=l:GetCameraHeight()local R=v-x.CFrame.p local q=R.Magnitude if l.currentSubjectDistance<q or e.X~=0 then local C=l:CalculateNewLookVector(R.Unit*a,Vector2.new(e.X,0))*math.min(q,l.currentSubjectDistance)local E=O.p-C local V=x.CFrame.LookVector if e.X~=0 then V=C end z=CFrame.new(E,Vector3.new(E.X+V.X,E.Y,E.Z+V.Z))+Vector3.new(0,w,0)end else l.curAzimuthRad=l.curAzimuthRad-e.X if l.useAzimuthLimits then l.curAzimuthRad=math.clamp(l.curAzimuthRad,l.minAzimuthAbsoluteRad,l.maxAzimuthAbsoluteRad)else l.curAzimuthRad=l.curAzimuthRad~=0 and math.sign(l.curAzimuthRad)*(math.abs(l.curAzimuthRad)%u)or 0 end l.curElevationRad=math.clamp(l.curElevationRad+e.Y,l.minElevationRad,l.maxElevationRad)z=CFrame.new(v+l.currentSubjectDistance*(CFrame.fromEulerAnglesYXZ(-l.curElevationRad,l.curAzimuthRad,0)*w),v)end l.lastCameraTransform=z l.lastCameraFocus=Z if(n or y)and d:IsA("\066\097\115\101\080\097\114\116")then l.lastSubjectCFrame=d.CFrame else l.lastSubjectCFrame=nil end end l.lastUpdate=O return z,Z end return O


local v1 = Vector3.new(0, 0, 1);
local v2 = {
	InitialDistance = 25, 
	MinDistance = 10, 
	MaxDistance = 100, 
	InitialElevation = 35, 
	MinElevation = 35, 
	MaxElevation = 35, 
	ReferenceAzimuth = -45, 
	CWAzimuthTravel = 90, 
	CCWAzimuthTravel = 90, 
	UseAzimuthLimits = false
};
local v3 = require(script.Parent:WaitForChild("BaseCamera"));
local v4 = setmetatable({}, v3);
v4.__index = v4;
function v4.new()
	local v5 = setmetatable(v3.new(), v4);
	v5.lastUpdate = tick();
	v5.changedSignalConnections = {};
	v5.refAzimuthRad = nil;
	v5.curAzimuthRad = nil;
	v5.minAzimuthAbsoluteRad = nil;
	v5.maxAzimuthAbsoluteRad = nil;
	v5.useAzimuthLimits = nil;
	v5.curElevationRad = nil;
	v5.minElevationRad = nil;
	v5.maxElevationRad = nil;
	v5.curDistance = nil;
	v5.minDistance = nil;
	v5.maxDistance = nil;
	v5.gamepadDollySpeedMultiplier = 1;
	v5.lastUserPanCamera = tick();
	v5.externalProperties = {};
	v5.externalProperties.InitialDistance = 25;
	v5.externalProperties.MinDistance = 10;
	v5.externalProperties.MaxDistance = 100;
	v5.externalProperties.InitialElevation = 35;
	v5.externalProperties.MinElevation = 35;
	v5.externalProperties.MaxElevation = 35;
	v5.externalProperties.ReferenceAzimuth = -45;
	v5.externalProperties.CWAzimuthTravel = 90;
	v5.externalProperties.CCWAzimuthTravel = 90;
	v5.externalProperties.UseAzimuthLimits = false;
	v5:LoadNumberValueParameters();
	return v5;
end;
function v4.LoadOrCreateNumberValueParameter(p1, p2, p3, p4)
	local v6 = script:FindFirstChild(p2);
	if v6 and v6:isA(p3) then
		p1.externalProperties[p2] = v6.Value;
	else
		if p1.externalProperties[p2] == nil then
			return;
		end;
		v6 = Instance.new(p3);
		v6.Name = p2;
		v6.Parent = script;
		v6.Value = p1.externalProperties[p2];
	end;
	if p4 then
		if p1.changedSignalConnections[p2] then
			p1.changedSignalConnections[p2]:Disconnect();
		end;
		p1.changedSignalConnections[p2] = v6.Changed:Connect(function(p5)
			p1.externalProperties[p2] = p5;
			p4(p1);
		end);
	end;
end;
function v4.SetAndBoundsCheckAzimuthValues(p6)
	p6.minAzimuthAbsoluteRad = math.rad(p6.externalProperties.ReferenceAzimuth) - math.abs(math.rad(p6.externalProperties.CWAzimuthTravel));
	p6.maxAzimuthAbsoluteRad = math.rad(p6.externalProperties.ReferenceAzimuth) + math.abs(math.rad(p6.externalProperties.CCWAzimuthTravel));
	p6.useAzimuthLimits = p6.externalProperties.UseAzimuthLimits;
	if p6.useAzimuthLimits then
		p6.curAzimuthRad = math.max(p6.curAzimuthRad, p6.minAzimuthAbsoluteRad);
		p6.curAzimuthRad = math.min(p6.curAzimuthRad, p6.maxAzimuthAbsoluteRad);
	end;
end;
function v4.SetAndBoundsCheckElevationValues(p7)
	local v7 = math.max(p7.externalProperties.MinElevation, -80);
	local v8 = math.min(p7.externalProperties.MaxElevation, 80);
	p7.minElevationRad = math.rad(math.min(v7, v8));
	p7.maxElevationRad = math.rad(math.max(v7, v8));
	p7.curElevationRad = math.max(p7.curElevationRad, p7.minElevationRad);
	p7.curElevationRad = math.min(p7.curElevationRad, p7.maxElevationRad);
end;
function v4.SetAndBoundsCheckDistanceValues(p8)
	p8.minDistance = p8.externalProperties.MinDistance;
	p8.maxDistance = p8.externalProperties.MaxDistance;
	p8.curDistance = math.max(p8.curDistance, p8.minDistance);
	p8.curDistance = math.min(p8.curDistance, p8.maxDistance);
end;
function v4.LoadNumberValueParameters(p9)
	p9:LoadOrCreateNumberValueParameter("InitialElevation", "NumberValue", nil);
	p9:LoadOrCreateNumberValueParameter("InitialDistance", "NumberValue", nil);
	p9:LoadOrCreateNumberValueParameter("ReferenceAzimuth", "NumberValue", p9.SetAndBoundsCheckAzimuthValue);
	p9:LoadOrCreateNumberValueParameter("CWAzimuthTravel", "NumberValue", p9.SetAndBoundsCheckAzimuthValues);
	p9:LoadOrCreateNumberValueParameter("CCWAzimuthTravel", "NumberValue", p9.SetAndBoundsCheckAzimuthValues);
	p9:LoadOrCreateNumberValueParameter("MinElevation", "NumberValue", p9.SetAndBoundsCheckElevationValues);
	p9:LoadOrCreateNumberValueParameter("MaxElevation", "NumberValue", p9.SetAndBoundsCheckElevationValues);
	p9:LoadOrCreateNumberValueParameter("MinDistance", "NumberValue", p9.SetAndBoundsCheckDistanceValues);
	p9:LoadOrCreateNumberValueParameter("MaxDistance", "NumberValue", p9.SetAndBoundsCheckDistanceValues);
	p9:LoadOrCreateNumberValueParameter("UseAzimuthLimits", "BoolValue", p9.SetAndBoundsCheckAzimuthValues);
	p9.curAzimuthRad = math.rad(p9.externalProperties.ReferenceAzimuth);
	p9.curElevationRad = math.rad(p9.externalProperties.InitialElevation);
	p9.curDistance = p9.externalProperties.InitialDistance;
	p9:SetAndBoundsCheckAzimuthValues();
	p9:SetAndBoundsCheckElevationValues();
	p9:SetAndBoundsCheckDistanceValues();
end;
function v4.GetModuleName(p10)
	return "OrbitalCamera";
end;
local u1 = require(script.Parent:WaitForChild("CameraUtils"));
function v4.SetInitialOrientation(p11, p12)
	if not p12 or not p12.RootPart then
		warn("OrbitalCamera could not set initial orientation due to missing humanoid");
		return;
	end;
	assert(p12.RootPart, "");
	local l__Unit__9 = (p12.RootPart.CFrame.LookVector - Vector3.new(0, 0.23, 0)).Unit;
	if not u1.IsFinite((u1.GetAngleBetweenXZVectors(l__Unit__9, p11:GetCameraLookVector()))) then

	end;
	if not u1.IsFinite(math.asin(p11:GetCameraLookVector().Y) - math.asin(l__Unit__9.Y)) then

	end;
end;
function v4.GetCameraToSubjectDistance(p13)
	return p13.curDistance;
end;
local l__Players__2 = game:GetService("Players");
function v4.SetCameraToSubjectDistance(p14, p15)
	if l__Players__2.LocalPlayer then
		p14.currentSubjectDistance = math.clamp(p15, p14.minDistance, p14.maxDistance);
		p14.currentSubjectDistance = math.max(p14.currentSubjectDistance, p14.FIRST_PERSON_DISTANCE_THRESHOLD);
	end;
	p14.inFirstPerson = false;
	p14:UpdateMouseBehavior();
	return p14.currentSubjectDistance;
end;
local u3 = Vector3.new(0, 0, 0);
function v4.CalculateNewLookVector(p16, p17, p18)
	local v10 = p17 or p16:GetCameraLookVector();
	local v11 = math.asin(v10.Y);
	local v12 = Vector2.new(p18.X, (math.clamp(p18.Y, v11 - 1.3962634015954636, v11 - -1.3962634015954636)));
	return (CFrame.Angles(0, -v12.X, 0) * CFrame.new(u3, v10) * CFrame.Angles(-v12.Y, 0, 0)).LookVector;
end;
local u4 = require(script.Parent:WaitForChild("CameraInput"));
local l__VRService__5 = game:GetService("VRService");
local u6 = Vector3.new(1, 0, 1);
local u7 = 2 * math.pi;
function v4.Update(p19, p20)
	local v13 = tick();
	local v14 = v13 - p19.lastUpdate;
	local v15 = u4.getRotation() ~= Vector2.new();
	local l__CurrentCamera__16 = workspace.CurrentCamera;
	local v17 = l__CurrentCamera__16.CFrame;
	local l__Focus__18 = l__CurrentCamera__16.Focus;
	local v19 = l__CurrentCamera__16 and l__CurrentCamera__16.CameraSubject;
	local v20 = v19 and v19:IsA("VehicleSeat");
	local v21 = v19 and v19:IsA("SkateboardPlatform");
	if p19.lastUpdate == nil or v14 > 1 then
		p19.lastCameraTransform = nil;
	end;
	if v15 then
		p19.lastUserPanCamera = tick();
	end;
	local v22 = p19:GetSubjectPosition();
	if v22 and l__Players__2.LocalPlayer and l__CurrentCamera__16 then
		if p19.gamepadDollySpeedMultiplier ~= 1 then
			p19:SetCameraToSubjectDistance(p19.currentSubjectDistance * p19.gamepadDollySpeedMultiplier);
		end;
		local l__VREnabled__23 = l__VRService__5.VREnabled;
		local v24 = l__VREnabled__23 and p19:GetVRFocus(v22, v14) or CFrame.new(v22);
		local v25 = u4.getRotation();
		if l__VREnabled__23 and not p19:IsInFirstPerson() then
			local v26 = p19:GetCameraHeight();
			local v27 = v22 - l__CurrentCamera__16.CFrame.p;
			local l__Magnitude__28 = v27.Magnitude;
			if p19.currentSubjectDistance < l__Magnitude__28 or v25.X ~= 0 then
				local v29 = p19:CalculateNewLookVector(v27.Unit * u6, Vector2.new(v25.X, 0)) * math.min(l__Magnitude__28, p19.currentSubjectDistance);
				local v30 = v24.p - v29;
				local v31 = l__CurrentCamera__16.CFrame.LookVector;
				if v25.X ~= 0 then
					v31 = v29;
				end;
				v17 = CFrame.new(v30, (Vector3.new(v30.X + v31.X, v30.Y, v30.Z + v31.Z))) + Vector3.new(0, v26, 0);
			end;
		else
			p19.curAzimuthRad = p19.curAzimuthRad - v25.X;
			if p19.useAzimuthLimits then
				p19.curAzimuthRad = math.clamp(p19.curAzimuthRad, p19.minAzimuthAbsoluteRad, p19.maxAzimuthAbsoluteRad);
			else
				p19.curAzimuthRad = p19.curAzimuthRad ~= 0 and math.sign(p19.curAzimuthRad) * (math.abs(p19.curAzimuthRad) % u7) or 0;
			end;
			p19.curElevationRad = math.clamp(p19.curElevationRad + v25.Y, p19.minElevationRad, p19.maxElevationRad);
			v17 = CFrame.new(v22 + p19.currentSubjectDistance * (CFrame.fromEulerAnglesYXZ(-p19.curElevationRad, p19.curAzimuthRad, 0) * v1), v22);
		end;
		p19.lastCameraTransform = v17;
		p19.lastCameraFocus = l__Focus__18;
		if (v20 or v21) and v19:IsA("BasePart") then
			p19.lastSubjectCFrame = v19.CFrame;
		else
			p19.lastSubjectCFrame = nil;
		end;
	end;
	p19.lastUpdate = v13;
	return v17, l__Focus__18;
end;
return v4;
