local function c(c,A)local p=0 local l,u=c:GetBoundingBox()local I=(l-l.p):inverse()l=l*I u=I*u u=Vector3.new(math.abs(u.x),math.abs(u.y),math.abs(u.z))local Z=0 local q=math.max(u.x,u.y,u.z)local h=math.tan(math.rad(A.FieldOfView/2))if q==u.x then Z=math.sqrt(u.y*u.y+u.z*u.z)/2 elseif q==u.y then Z=math.sqrt(u.x*u.x+u.z*u.z)/2 else Z=math.sqrt(u.x*u.x+u.y*u.y)/2 end local r=(q/2)/h+Z if c.Name=="\067\097\109"then r+=1 end return RunService.RenderStepped:Connect(function(c)local u=((1*c)*60)/1.5 p=p+u A.CFrame=(l*CFrame.fromEulerAnglesYXZ(0,math.rad(p),0))*CFrame.new(0,0,r-1)end)end
--// Rotate viewport
local function setRotationEvent(model, camera)
	local currentAngle = 0
	local modelCF, modelSize = model:GetBoundingBox()

	local rotInv = (modelCF - modelCF.p):inverse()
	modelCF = modelCF * rotInv
	modelSize = rotInv * modelSize
	modelSize = Vector3.new(math.abs(modelSize.x), math.abs(modelSize.y), math.abs(modelSize.z))

	local diagonal = 0
	local maxExtent = math.max(modelSize.x, modelSize.y, modelSize.z)
	local tan = math.tan(math.rad(camera.FieldOfView / 2))

	if maxExtent == modelSize.x then
		diagonal = math.sqrt(modelSize.y * modelSize.y + modelSize.z * modelSize.z) / 2
	elseif maxExtent == modelSize.y then
		diagonal = math.sqrt(modelSize.x * modelSize.x + modelSize.z * modelSize.z) / 2
	else
		diagonal = math.sqrt(modelSize.x * modelSize.x + modelSize.y * modelSize.y) / 2
	end

	local minDist = (maxExtent / 2) / tan + diagonal
	if model.Name == "Cam" then
		minDist += 1
	end

	return RunService.RenderStepped:Connect(function(dt)
		local increase = (1 * dt * 60) / 1.5
		currentAngle = currentAngle + increase
		camera.CFrame = modelCF
			* CFrame.fromEulerAnglesYXZ(0, math.rad(currentAngle), 0)
			* CFrame.new(0, 0, (minDist - 1))
	end)
end
