How would I make it so that you can’t turn you screen on mobile?
I don’t want the player to be able to switch this way.
How would I make it so that you can’t turn you screen on mobile?
I don’t want the player to be able to switch this way.
Actually, there’s a setting, as far I know, on all mobile devices that players can toggle that prevents their screen from flipping. so you won’t need to worry about that.
Also, Roblox games by default don’t flip the screens vertically iirc. They lock it to horizontal.
How would I adjust that setting? Because your able to switch it on my experience.
For iphone and ipad:
For android:
Wait, are you sure its not a setting in starterplayer?
I’m not sure.
Is there a specific setting that you’re confused with in StarterPlayer that has to do with mobile screen orientation?
Devtouchcameramovementmode is what im confused with
DevTouchCameraMovementMode overwrite’s a player’s camera based on the movement the player does in the game. It does not affect screen orientation.
Read here for more info:
So uh how do I make it so you can’t make your screen vertical?
It won’t.
By default, Roblox sets your screens to horizontal orientation only when playing a game.
You would have to go out of your way to script your game so the camera would be able rotate vertically.
What do you mean? On mobile you can rotate the screen vertical.
Try joining any Roblox game (besides word bomb) and attempt to switch your screen vertically without toggling the setting I mentioned in the beginning.
Ohhh I thought it was roblox that was making it so you could rotate it. How would I be able to detect if the player rotated it vertical so I could make a custom gui.
Unless you’re specifically intending to make your game have a vertical mobile screen, you won’t have to worry about that kind of situation happening.
The only types of games I’ve seen do this are games such as Word Bomb. They have purposely done this for mobile devices, so it would be easier to type on mobile, which is a necessity for their game.
No, I wanted to fix the UI on vertical if someone makes it that way.
https://developer.roblox.com/en-us/articles/Device-Orientation-for-Mobile-Roblox-Games
game.Players.LocalPlayer.PlayerGui.ScreenOrientation = Enum.ScreenOrientation.LandscapeSensor
By default, the screen orientation is always set to Landscape Sensor, meaning it will only switch to Landscape Left or Right but not to Portrait, if you want to know more about this read the article I linked above.
local Players = game:GetService("Players")
local playerGUI = Players.LocalPlayer:WaitForChild("PlayerGui")
task.wait(2)
playerGUI.ScreenOrientation = Enum.ScreenOrientation.LandscapeLeft