SOLVED Cant Get input Events To Happen

This should work right?
I have a similar setup in a project made in 2019.3.0b4 (or was it b3)
And that project still works in b8
But in any new projects I make I cant get the new input system to work.

Active Input Handling in player settings is Both (also tried with input system only)

using UnityEngine;
using UnityEngine.InputSystem;

public class AnyKeyTest : MonoBehaviour
{
    public  InputActionAsset inputActionAsset;

    InputAction action;

    private void Awake( )
    {
        var inputActions = inputActionAsset.FindActionMap( "any" );
        action = inputActions.FindAction( "any" );
       
    }

    private void OnEnable( )
    {
        action.started += OnStarted;
        action.performed += OnPerformed;
        action.canceled += OnCanceled;
       
    }

    private void OnDisable( )
    {

        action.started -= OnStarted;
        action.performed -= OnPerformed;
        action.canceled -= OnCanceled;

    }

    private void OnStarted( InputAction.CallbackContext obj )
    {
        Debug.Log( "started" );
    }

    private void OnCanceled( InputAction.CallbackContext obj )
    {
        Debug.Log( "canceled" );
    }




    public void OnPerformed( InputAction.CallbackContext obj )
    {
        Debug.Log( "Performed" );
    }
}

Debug log your InputAction.phase and see if the current state is “Disabled”. If so, you will need to Enable it by doing InputActionAsset.Enable() in Awake(). If not, check your bindings again and ensure they are setup correctly.

Oh my how did I miss that
Thank you so much

1 Like