Camera.ViewportSize incorrect at start of studio test

When running the game in studio, workspace.Camera.ViewportSize is (1, 1) and then updates to the correct size after 0.2 seconds

Studio:
Camera Viewport Size update delay test.rbxl (54.0 KB)

In-game:

The localscript is in StarterPlayerScripts. Even when it’s in ReplicatedFirst, the correct size is printed in-game.

8 Likes

Thanks for the report! I filed a ticket in our internal database and we’ll follow up when we have an update for you.

1 Like

The issue is still up. Any more news?

EDIT: Currently, I’ve made something that counters up this bug; however, it’s probably not the best way of doing this.

local cam = workspace.CurrentCamera

local screenSize = cam.ViewportSize

repeat
    screenSize = cam.ViewportSize

    task.wait()
until screenSize.X > 1 -- We don't need to check for Y axis as both X and Y get changed simultaneously. It doesn't matter which one axis to use.
3 Likes

Greetings! This ticket has been closed as a Duplicate, You can follow up on the active thread:
Camera.ViewportSize returns 1,1 on start of running in Studio

2 Likes