I have ScreenOrientation set to LandscapeRight in my game. And what I am doing in some scripts is that I declare a constant this way:
local SCREEN_AREA = GuiService:GetInsetArea(Enum.ScreenInsets.None)
Unfortunately, despite the fact that ScreenOrientation is applied sometimes it takes time for Roblox to see it and because of that scripts will have SCREEN_AREA set as 400 x 900 for the rest of the execution and not 900 x 400.
Hey! This looks like a timing issue rather than something wrong with your code.
ScreenOrientation isn’t applied immediately — the engine updates it asynchronously, so if you query things like GetInsetArea right after setting it, you can still get values from the previous orientation for a frame or two.
Instead of reading it once (especially during initialization), you might want to listen for when the orientation actually updates:
local GuiService = game:GetService("GuiService")
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local function update()
local area = GuiService:GetInsetArea(Enum.ScreenInsets.None)
print(playerGui.CurrentScreenOrientation, area)
-- update your layout here
end
playerGui:GetPropertyChangedSignal("CurrentScreenOrientation"):Connect(update)
This way you’re reacting to the real applied orientation instead of racing it.
Will close this bug and mark as “Won’t Fix” since the above solution should resolve the problem. Thank you for taking the time to share the report.