Game not starting in portrait mode (Despite ScreenOrientation set to Portrait)

I’m prototyping a game, here:

In the StarterGui I have the ScreenOrientation set to Portrait, but when I connect to the game on my phone it is in landscape. Additionally, if I set it to Sensor it still cannot be taken out of landscape.

Am I doing something wrong?

5 Likes

Same thing happened to me. I’m setting it in a script for now in ReplicatedFirst.

Thanks for the reply.

I just tried that in a localscript in ReplicatedFirst:

game:GetService("StarterGui").ScreenOrientation = Enum.ScreenOrientation.Portrait

However, this doesn’t seem to have any effect on my mobile device.

[Edit]
Ah, nevermind. I needed to set the individual player’s ScreenOrientation via PlayerGui, that fixes it! Thanks @wravager

2 Likes

This bug still exists and it seems like manually setting the orientation doesn’t work.

1 Like

I’ve tried manually setting it in ReplicatedFirst, and it immediately reverts back to landscape…

Does anyone have a fix for this? I think this may be a problem only ROBLOX can fix.

I’m also experiencing this. I’ve had my fair share of bugs using the mobile app. I’m on an iPhone X with the latest version. Whenever I play a game, it starts in portrait mode. It waits for the game to load, then switches. I’m not sure if this is a bug, or something.

This is still an issue. Setting my game to portrait via StarterGui or PlayerGui has the mobile app loading in portrait, then after a few seconds it switches back and forth several times quickly, then ends in landscape.

This is a huge problem for the game that i’m making. Does anyone know of a workaround?

[Edit]
It seems that if I wait() before setting it to portrait via PlayerGui then it will correctly switch orientations. This isn’t ideal as the app will still switch to landscape after loading before switching back to portrait, which is ugly, though I can live with it.

1 Like

This appears to have been fixed in update 398.
image

1 Like

I just did a test in a new place with the only change being to set it to portrait mode. If the phone is in portrait, then roblox will start loading the place in portrait, then just before it finishes loading it will switch back to landscape, then back to portrait again.

I’ve discovered after further testing that the issue I was having above where the game wouldn’t load into portrait even with StarterGui set to portrait was because I was using custom characters and had CharacterAutoLoads turned off. I guess it makes sense that this would be the case, but whether your game can load into portrait or not shouldn’t be determined by whether or not you auto load the character in my opinion. Your only option then is to wait() and use PlayerGui to switch the player into portrait.

Bumping this because it looks like the fix got reverted, or perhaps never got fixed. My game uses ScreenOrientation = Sensor, and it does not start in portrait mode when my phone launches it from the portrait-oriented app. It starts in landscape, with my phone vertical in my hand, and then I have to awkwardly rotate the phone sideways then back up to make it portrait.

Using iphone 7plus, game is https://www.roblox.com/games/1254627757/lolwut#!/game-instances

4 Likes

Bump on this. Experiencing odd issues currently. I have StarterGui set to Portrait, and in ReplicatedFirst, I set both StarterGui and the Players PlayerGui to Portrait too.

When my game starts though, It tries to switch to landscape for a split second then reverts back to portrait. The only issue with this is it leaves a thick black vertical line on my screen…

This black line seems like it’s the one used to cover up the notch on newer iphones, but it is on the side of my phone not on the notch, when on portrait mode.

[EDIT]
Additionally, if I set CharacterAutoLoads to false (in Players Service), the workaround script doesn’t work at all (Setting PlayerGui to portrait mode)

Bumping because I’m having the same issue of setting Portrait mode in StarterGui but roblox is acting as if it’s set to LandscapeSensor. Seems like a roblox Core issue. I’ve also experienced the black bar issue as mentioned above.

Hello, I’m also having the same problem. But for me it’s just not working even if I script it or change the orientation from StarterGui.

The ScreenOrientation doesnt seem to change for me.

Edit: Nvm this seems to fix it.

Edit2: I tried using Sensor but it’s not detecting when I switch my phone back to landscape.

Edit3: There might still be a way for players to change their ScreenOrientation by saving the Orientation they want and quickly changing into that orientation when they rejoin the game. I have not tried this yet, but I will try it in the future and let people know if this works.

Still happens…

Best solution is to just force it for the first few seconds of a game. If set to Sensor it will correct itself without need for motion after the initial flop (at least on my phone) when default loading screen goes away

RunService:BindToRenderStep("ScreenOrientation", Enum.RenderPriority.Last.Value, function()
	PlayerGui.ScreenOrientation = Enum.ScreenOrientation.Portrait
	OrientationTries = OrientationTries + 1
	if OrientationTries > 300 then
		RunService:UnbindFromRenderStep("ScreenOrientation")
	end
end)

My phone is a Moto E (2020) and my OS is Android 10 if that matters.

Edit: I also have CharacterAutoLoads set to false