Error when reading CallbackContext

I’m receiving an error when utilizing the code below.

    public void OnMouseScroll(InputAction.CallbackContext context)
    {
        Debug.Log(context.ReadValue<Vector2>());
    }

6455263--723445--inputsystem.PNG6455263--723442--Actions.PNG 6455263--723451--SendMessage.PNG

Messages cannot receive InputAction.CallbackContext arguments. Events must be used to receive the full callback context. Messages either need to be without an argument (for buttons) or take an InputValue argument.

1 Like

Unity should provide a clearer error message for this. I saw quite a few threads asking the same question, and it wastes developer time.

5 Likes

Seconded. Haven’t found a single tutorial that explains this aspect properly

2 Likes