This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- black frames not included | |
local RunService = game:GetService("RunService") | |
local Workspace = game:GetService("Workspace") | |
local Camera = Workspace.CurrentCamera | |
local Module = {} | |
Module.Position = UDim2.new(0, 0, 0, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local camera, cameraChanged | |
local viewport, viewportChanged | |
-- Challenge: | |
-- 1. Make `camera' always point to the the current or last known camera. | |
-- a. Problem: CurrentCamera can be nil. | |
-- b. Guarantee that `camera' is never nil. | |
-- 2. Make `viewport' always be the current actual size of the viewport. | |
-- a. Problem: ViewportSize can falsely report (1,1) before it gets fixed up by RenderPrepare. | |
-- b. Guarantee that `viewport' is never (1,1). |