I want to use InputActionReference to manually change InputAction in Unity Editor.
So I declare this field:
[SerializeField] private InputActionReference moveInputAction;
and add some methods
moveInputAction.action.Enable();
moveInputAction.action.performed += ActiveAction;
moveInputAction.action.canceled += ActiveAction;
However, ActiveAction was never called. And when i added those code to see what happened
Debug.Log(moveInputAction.action);
Debug.Log(moveInputAction.ToInputAction()); // Similar to moveInputAction.action
Debug.Log(GetComponentInParent<InputActionController>().InputAction.Player.Move); // this directly get the input action from my auto-generated InputActionAsset instance
I got the following result:

image692×125 6.15 KB
Seem like InputActionReference.action have no bindings.
Today I added some new lines:
Debug.Log(moveInputAction.asset.GetInstanceID());
Debug.Log(GetComponentInParent<InputActionController>().InputAction.asset.GetInstanceID());
the ids weren’t even the same
Do you have any solution for this ?