local I={}I.__index=I function I.new(h,w,u,i)local J=setmetatable({},I)J.Humanoid=h J.HRP=h.RootPart J.LastPosition=J.HRP.Position J.TeleportTick=tick()J.WindowA=w J.WindowB=u J.World=nil J.WorldLookupA={}J.WorldLookupB={}J.CharacterLookups={}J.Sky=nil J.SkyA=nil J.SkyB=nil J.CameraModule=i J.LastCameraCFrame=workspace.CurrentCamera.CFrame J.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(I)workspace.CurrentCamera.CFrame=J.LastCameraCFrame workspace.CurrentCamera.Focus=J.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(I)J:OnAfterCameraStep(I)end)return J end
-- Class

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
