Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Control index is out of range spam

Discussion in 'Input System' started by ExplosiveBarrels, Dec 11, 2020.

  1. ExplosiveBarrels

    ExplosiveBarrels

    Joined:
    Oct 18, 2016
    Posts:
    10
    I've hooked up the gamepad's joystick and directional pad to an InputAction that sends a Vector2 value.
    In PlayerInput, that input action sends a unity event with the InputAction.CallbackContext

    I have a listener to that event that reads a Vector2 value from the InputAction.CallbackContext

    And it mostly works, except as soon as I let go it spams the console with "Control index is out of range", referencing the line where I read the Vector2 from the nputAction.CallbackContext.

    I've tried checking the valueType to ensure it's a vector2, and it is.
     
  2. ExplosiveBarrels

    ExplosiveBarrels

    Joined:
    Oct 18, 2016
    Posts:
    10
    Specifically it happens when I use the joystick, rather than the d-pad. There's no console error messages if I use only the d-pad for movement.