Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Set Screen Orientation#

Screen / Set Screen Orientation

Description#

Changes the orientation of the screen on mobile devices

Parameters#

Name Description
Orientation Auto Rotation follows the device within the orientations its Autorotate settings allow

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Set Screen Orientation")]
    [Category("Screen/Orientation")]
    [Description("Changes the orientation of the screen on mobile devices")]

    [Image(typeof(IconScreen), ColorTheme.Type.TextLight)]
    [Keywords("Display", "Mobile", "Portrait", "Landscape", "Rotation", "Rotate")]

    [Parameter("Orientation", "Auto Rotation follows the device within the orientations its Autorotate settings allow")]

    [Serializable]
    public class InstructionScreenSetOrientation : Instruction
    {
        [SerializeField] private ScreenOrientation m_Orientation = ScreenOrientation.AutoRotation;

        protected override string GetTitle(GameObject source)
        {
            string className = TextUtils.ThemeAsKeyword("Screen");
            string member = TextUtils.ThemeAsKeyword("Orientation");
            return $"{className} {member} = {this.m_Orientation}";
        }

        protected override Awaitable Run(Args args)
        {
            Screen.orientation = this.m_Orientation;
            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.