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

Gamepad Count#

Input / Gamepad Count

  • Can Read

  • Cannot Write

Description#

Returns how many Gamepads are currently connected

Code#

using System;
using UnityEngine.InputSystem;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Gamepad Count")]
    [Category("Input/Gamepad Count")]

    [Description("Returns how many Gamepads are currently connected")]
    [Image(typeof(IconGamepad), ColorTheme.Type.Blue, typeof(BadgeHash))]

    [Keywords("Controller", "Devices", "Players", "Connected", "Amount")]

    [Serializable]
    public class TypeNumberInputGamepadCount : TypeNumber
    {
        public override double Get(Args args)
        {
            return Gamepad.all.Count;
        }

        public override string ToString()
        {
            return "Gamepad Count";
        }

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