---
tags:
    - "System"
---

# On Input Action Start

[Input](../index.md) / [Input Actions](index.md) / **On Input Action Start**

## Description

Executes when an Input Action raises the Started event

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("On Input Action Start")]
    [Image(typeof(IconBoltOutline), ColorTheme.Type.Teal, typeof(BadgeArrowDown))]
    
    [Description("Executes when an Input Action raises the Started event")]
    [Category("Input/Input Actions/On Input Start")]
    
    [Keywords("System")]

    [Serializable]
    public class TriggerCoreInputActionStart : Trigger
    {
        // EXPOSED MEMBERS: -----------------------------------------------------------------------

        [SerializeField] private InputActionFromAsset m_InputAction = new InputActionFromAsset();
        
        // PROPERTIES: ----------------------------------------------------------------------------

        protected override string GetTitle(GameObject source) => $"{this.m_InputAction} Start";

        // OVERRIDE METHODS: ----------------------------------------------------------------------

        public override void OnEnable()
        {
            base.OnEnable();
            
            UnityEngine.InputSystem.InputAction inputAction = this.m_InputAction.InputAction;
            if (inputAction != null) inputAction.started += this.OnInputCall;
        }

        public override void OnDisable()
        {
            base.OnDisable();
            
            UnityEngine.InputSystem.InputAction inputAction = this.m_InputAction.InputAction;
            if (inputAction != null) inputAction.started -= this.OnInputCall;
        }

        private void OnInputCall(UnityEngine.InputSystem.InputAction.CallbackContext context)
        {
            using Args args = Args.Get(this.Component, this.Component);
            this.Run(args);
        }
    }
}
```

