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 Map#

Input / Enable Input Map

Description#

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

Parameters#

Name Description
Input Asset The Input Asset reference and Map

Code#

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

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

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

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