local N={}N.__index=N function N.new(y,o,z,A)local Y=setmetatable({},N)Y.Humanoid=y Y.HRP=y.RootPart Y.LastPosition=Y.HRP.Position Y.TeleportTick=tick()Y.WindowA=o Y.WindowB=z Y.World=nil Y.WorldLookupA={}Y.WorldLookupB={}Y.CharacterLookups={}Y.Sky=nil Y.SkyA=nil Y.SkyB=nil Y.CameraModule=A Y.LastCameraCFrame=workspace.CurrentCamera.CFrame Y.LastCameraFocus=workspace.CurrentCamera.Focus RUNSERVICE:BindToRenderStep("\080\111\114\116\097\108\066\101\102\111\114\101\073\110\112\117\116",Enum.RenderPriority.Input.Value-1,function(N)workspace.CurrentCamera.CFrame=Y.LastCameraCFrame workspace.CurrentCamera.Focus=Y.LastCameraFocus end)RUNSERVICE:BindToRenderStep("\080\111\114\116\097\108\065\102\116\101\114\067\097\109\101\114\097",Enum.RenderPriority.Camera.Value+1,function(N)Y:OnAfterCameraStep(N)end)return Y end


local Portal = {}
Portal.__index = Portal

function Portal.new(humanoid, windowA, windowB, cameraModule)
	local self = setmetatable({}, Portal)
	
	self.Humanoid = humanoid
	self.HRP = humanoid.RootPart
	self.LastPosition = self.HRP.Position
	self.TeleportTick = tick()
	
	self.WindowA = windowA
	self.WindowB = windowB
	
	self.World = nil
	self.WorldLookupA = {}
	self.WorldLookupB = {}
	self.CharacterLookups = {}
	
	self.Sky = nil
	self.SkyA = nil
	self.SkyB = nil
	
	self.CameraModule = cameraModule
	self.LastCameraCFrame = workspace.CurrentCamera.CFrame
	self.LastCameraFocus = workspace.CurrentCamera.Focus
	
	RUNSERVICE:BindToRenderStep("PortalBeforeInput", Enum.RenderPriority.Input.Value - 1, function(dt)
		workspace.CurrentCamera.CFrame = self.LastCameraCFrame
		workspace.CurrentCamera.Focus = self.LastCameraFocus
	end)
	
	RUNSERVICE:BindToRenderStep("PortalAfterCamera", Enum.RenderPriority.Camera.Value + 1, function(dt)
		self:OnAfterCameraStep(dt)
	end)
	
	return self
end
