local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local LOCK_ORIENTATION = Enum.ScreenOrientation.LandscapeRight -- change the "Right" to "Left" if you don't like the way it set
RunService.RenderStepped:Connect(function()
playerGui.ScreenOrientation = LOCK_ORIENTATION
end)
Features & Information
This script forces the player’s screen orientation to stay locked in LandscapeRight (Left because the landscaping is reverse)
It works by:
getting the local player and their PlayerGui
setting a target orientation with Enum.ScreenOrientation.LandscapeRight
repeatedly reapplying that orientation every frame using RunService.RenderStepped
That means even if the game or device tries to change the orientation, this script keeps it fixed. The comment notes that you can switch it to LandscapeLeft by changing Right to Left.
Auto execute is recommended for no annoying auto tilting for mobile
Better version of @majwejner script
Enjoy the script!