Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[SOLVED] InvalidOperationException while executing 'performed' callbacks

Discussion in 'Input System' started by Nylash, May 5, 2020.

  1. Nylash

    Nylash

    Joined:
    Dec 4, 2017
    Posts:
    17
    Hi, I got a strange error which actually doesn't block my game from running but is spamming my console and I don't understand it.
    upload_2020-5-5_17-7-54.png
    and
    upload_2020-5-5_17-8-11.png
    Here is the configuration :
    upload_2020-5-5_17-11-22.png
    And here the only piece of code which call it :
    upload_2020-5-5_17-12-27.png

    upload_2020-5-5_17-12-48.png

    This error occurs each frame when I press an input link to yAxis. And what is strange, is that I use the exact same system for xAxis but I got no error on it. The only difference is that I don't use xAxis in 2 scripts unlike yAxis. But, I don't think the problem come from my scripts, because if I desactivate them I still got the error.
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    The error is thrown from the UI input module (in particular, OnMove). Do you have the yAxis action linked to the "move" navigation action of InputSystemUIInputModule?
     
  3. Nylash

    Nylash

    Joined:
    Dec 4, 2017
    Posts:
    17
    Yes ! Thanks :)
     
  4. iiziziz

    iiziziz

    Joined:
    Mar 20, 2014
    Posts:
    11
    @Rene-Damm I'm sorry, I got the exact same problem, but I don't totally understand your answer.
    Can you explain a bit more ?
     
  5. Nylash

    Nylash

    Joined:
    Dec 4, 2017
    Posts:
    17
    In your eventSystem object you can configure which action from the map handle navigation, submit, cancel ...
    My issue was that I used a action set as an axis for the navigation of the EventSystem, and it wants a Vector2, so I simply do a second map, dedicated to the UI with a Vector2 for the navigation.
     
  6. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    88
    If someone is having this issue, and doesn't understand why. Make sure Vector2 is UnityEngine.Vector2 not
    System.Numerics.
     
    Tryptex and Sinkholy like this.
  7. paul-masri-stone

    paul-masri-stone

    Joined:
    Mar 23, 2020
    Posts:
    49
    In case it helps someone... I use a single callback function for `actionTriggered` to handle both mouse position and click but I was calling `ReadValue<Vector2>() in both cases`. Obviously this worked fine for the mouse position but caused the above error message during click because I was accessing the wrong input action.
     
  8. ASLH5368

    ASLH5368

    Joined:
    Apr 3, 2022
    Posts:
    1
    @Rene-Damm I am having the issue that paul-masri-stone was mentioning directly above this, I'm confused on how he solved it?
     
  9. SolvedGames

    SolvedGames

    Joined:
    Apr 8, 2022
    Posts:
    1
    upload_2022-4-10_17-23-14.png
    Make sure your Composite type is set to 2D vector. Then it should work.