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

Enable Input Action#

Input / Enable Input Action

Description#

Enables an Input Action asset with an Action value which allows reading user input

Parameters#

Name Description
Input Asset The Input Asset reference and Action name

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Enable Input Action")]
    [Image(typeof(IconBoltOutline), ColorTheme.Type.Teal)]
    
    [Description("Enables an Input Action asset with an Action value which allows reading user input")]
    [Category("Input/Enable Input Action")]
    
    [Parameter("Input Asset", "The Input Asset reference and Action name")]
    
    [Keywords("Activate", "Active")]
    
    [Serializable]
    public class InstructionCoreInputEnableAction : Instruction
    {
        [SerializeField] private InputActionFromAsset m_InputAsset = new InputActionFromAsset();

        protected override string GetTitle(GameObject source)
        {
            string input = TextUtils.ThemeAsConstant(this.m_InputAsset.ToString());
            return $"Enable {input}";
        }

        protected override Awaitable Run(Args args)
        {
            UnityEngine.InputSystem.InputAction inputAction = this.m_InputAsset.InputAction;
            if (inputAction is { enabled: false }) inputAction.Enable();
            
            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.