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

Selected Game Object#

Input / Selected Game Object

  • Can Read

  • Cannot Write

Description#

The user interface Game Object that is currently selected

Code#

using System;
using UnityEngine;
using UnityEngine.EventSystems;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Selected Game Object")]
    [Category("Input/Selected Game Object")]

    [Description("The user interface Game Object that is currently selected")]
    [Image(typeof(IconSelectable), ColorTheme.Type.TextLight)]

    [Keywords("UI", "Canvas", "Focus", "Highlight", "Navigation", "Button")]

    [Serializable]
    public class TypeGameObjectInputSelectedUI : TypeGameObject
    {
        public override GameObject Get(Args args)
        {
            EventSystem eventSystem = EventSystem.current;
            return eventSystem != null ? eventSystem.currentSelectedGameObject : null;
        }

        public override string ToString()
        {
            return "Selected Game Object";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.