Search Unity

Question Custom WASD composite (2d vector)

Discussion in 'Input System' started by plainandgamestudio, May 23, 2023.

  1. plainandgamestudio

    plainandgamestudio

    Joined:
    Aug 3, 2019
    Posts:
    1
    Hi there!

    I am trying to do a WASD composite that allows me to get the last button pressed, exactly as it is explained on this post: https://forum.unity.com/threads/using-last-key-pressed-in-a-composite-2d-vector.1109609/.
    The problem now is that, with this custom Composite I get the right value but my action callbacks don't get called, so my code never gets notified of the new values. Do you know how can this be achieved? any way to force the callbacks be called?
    My callback is just waiting for the context to have the value:
    Code (CSharp):
    1. private void OnMove(InputAction.CallbackContext context)
    2.         {
    3.             inputMovement = context.ReadValue<Vector2>();
    4.             Debug.Log($"Context {context.phase} value: {inputMovement}");
    5.         }