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

PlayerInput not reciving the event afer press

Discussion in 'Input System' started by lassade, Jun 3, 2021.

  1. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    I need some help, someone knows why `OnCancel` is only been called in the once? If a press ESC a second time nothing happens, `OnSubmit` and `OnNavigate` works fine:

    Code (CSharp):
    1. public class MyEventsCallback : MonoBehaviour
    2. {
    3.         private void OnNavigate(InputValue value)
    4.         {
    5.                 Debug.Log("OnNavigate");
    6.         }
    7.  
    8.         private void OnSubmit(InputValue value)
    9.         {
    10.                 Debug.Log("OnSubmit");
    11.         }
    12.  
    13.         private void OnCancel(InputValue value)
    14.         {
    15.                 // Why it's only been called in the first press, WUT ?!?
    16.                 Debug.Log("OnCancel");
    17.         }
    18. }
    PlayerInput setup (I did attached the script, I can get the OnSubmit just fine)

    Image1.png

    Image2.png

    If I remove the `Press` Interaction it works, but I now have 2 call of `OnCancel` instead of just one.

    Omg why this is happening, Please help!!!
     
  2. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    "Solution" Remove the Press interation and create the Input Configuration in PlayerPrefs;

    BTW: Unity guys, Input Configuration isn't optional it causes so many issues, that I think should be created for you by default, or at least give an error on run.

    It's like another moving part ready to brake everthing
     
  3. lassade

    lassade

    Joined:
    Jan 27, 2013
    Posts:
    127
    I'm using 1.0.2 by the way