I’ve found a bug with this, or atleast unintended behavior:
local camera = workspace.CurrentCamera do
local desiredType = Enum.CameraType.Scriptable
local start = os.clock()
local retries = 30
while camera.CameraType ~= desiredType and os.clock() < (start + 5) do
retries -= 1
camera.CameraType = desiredType
warn("(DEBUG)", "Setting camera type to", desiredType.Name, "took:", string.format("%.2f", os.clock() - start) .. "(s)")
wait(), this code sets the camera type to scriptable as intended, and warns a number anywhere from 2 to 3 as usual.
However, swapping the
task.wait() causes the camera type to not change, and the warned number will be from 0.00 to 0.06.