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

Input Action Number#

Input / Input Action Number

  • Can Read

  • Cannot Write

Description#

Returns an Input Action value of type float

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Input Action Number")]
    [Category("Input/Input Action Number")]

    [Description("Returns an Input Action value of type float")]
    [Image(typeof(IconBoltOutline), ColorTheme.Type.Teal)]

    [Keywords("Axis", "Trigger", "Analog", "Value")]

    [Serializable]
    public class TypeNumberInputActionValue : TypeNumber
    {
        [SerializeField] private InputActionFromAsset m_InputAction = new InputActionFromAsset();

        public override double Get(Args args)
        {
            UnityEngine.InputSystem.InputAction inputAction = this.m_InputAction.InputAction;
            return inputAction?.ReadValue<float>() ?? 0d;
        }

        public override string ToString()
        {
            return this.m_InputAction.ToString();
        }

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