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

Unity New Input System MultiplayerEventSystem and InputSystemUIInputModule is commented out

Discussion in 'Input System' started by shaq145, May 7, 2020.

  1. shaq145

    shaq145

    Joined:
    Jan 23, 2017
    Posts:
    8
    Hi. I just installed the New Unity Input System. The PlayerInput and so on is working. I can already play multiplayer using my keyboard and controller. But when I added a UI for the players and searched some tutorials, I found out that the InputSystemUIInputModule script in the Inspector is blank. I can't even search or use the MultiplayerEventSystem.
    When I look on the script for both it says:
    #if PACKAGE_DOCS_GENERATION || UNITY_INPUT_SYSTEM_ENABLE_UI
    as I posted below. unity input system.PNG

    What possible solution can I do? What does the if statement mean? Unity Input System is already enabled in my Player Settings. Should I choose "Both"?

    Thanks in advance. unity input system.PNG
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    The graying out doesn't necessarily have to mean much. Depends on whether VS realizes that those are defines are set.

    Could you post a screenshot of that?

    If the component is indeed not compiled, it would say "Missing script" in the inspector there. If the inspector for the component is blank, that sounds like a different issue.
     

    Attached Files:

  3. shaq145

    shaq145

    Joined:
    Jan 23, 2017
    Posts:
    8
    Here's the screenshot in the Inspector. unity input system2.PNG
     
  4. shaq145

    shaq145

    Joined:
    Jan 23, 2017
    Posts:
    8
    I already fixed that problem. I just need to update my Unity to version 2019.3, but another problem comes up. This includes the with the UI again. Whether I point, click, and pressed a button this error pops out in my console:

    MissingMethodException: UnityEngine.InputSystem.UI.InputSystemUIInputModule.OnRightClick Due to: Attempted to access a missing member.
    System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[] providedArgs, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParams) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.SetupCoroutine.InvokeMember (System.Object behaviour, System.String name, System.Object variable) (at <480508088aee40cab70818ff164a29d5>:0)
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)


    How can I fix this?
     
  5. javisarias

    javisarias

    Joined:
    Jan 21, 2017
    Posts:
    9
    @shaq145 were you able to fix this issue? I am running through the same problem
     
  6. ll3v3ll

    ll3v3ll

    Joined:
    Nov 14, 2014
    Posts:
    11
    @shaq145 @javisarias

    I had the same exception for SendMessage and the Input Action OnLook (instead of OnRightClick).

    The following worked for me (when using SendMessage as the Input Notification)

    1. Enable "Generate C# Class" on the Controls Import Settings (Input Action Importer).
    2. On the target GameObject, have one MonoBehavior that can accept the SendMessage for the Action:

    Code (CSharp):
    1.  
    2.     public void OnLook(InputValue value)
    3.     {
    4.         //Debug.Log("OnLook " + value.Get<Vector2>());
    5.     }
    6.  
     
  7. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    379
    I had a similar issue here but it was due to my function name having the same name as the functions generated in 'Player Input' class. In my case I was using 'OnPointerMove' which clashed with the same function in the Player Input class (guessing SendMessage() doesn't like this).
     
    rimmarpl and bhermer like this.
  8. masak

    masak

    Joined:
    Aug 14, 2011
    Posts:
    51
    I encountered a same issue when PlayerInput and InputSystemUIInputModule exist on same Gameobejct. I attached the PlayerInput on other gameobject, and solved the issue.
     
    metrixkita and LordAvarice like this.
  9. haywirephoenix

    haywirephoenix

    Joined:
    May 17, 2017
    Posts:
    100
    I had the same error, until I switched my PlayerInput's Behaviour to "Invoke C# Events"
     
    rimmarpl likes this.
  10. LordAvarice

    LordAvarice

    Joined:
    Jan 6, 2016
    Posts:
    4
    Thank you! this was the end of a ~2 hour search. Problem fixed. (Changed to playerinput.notificationBehavior = PlayerNotifications.InvokeUnityEvents)

    We need a layerinput.notificationBehavior = PlayerNotifications.None option. I'm using polling so this would be perfect and cost less in performance.

    Side note, if you make a InputActionAsset from json the InputSystemUIInputModule inspector will only display none for all action types. but if set from script at runtime it still works as expected. only confusing from a debugging standpoint.
     
  11. azudevcr

    azudevcr

    Joined:
    Oct 6, 2021
    Posts:
    1
    well my error was too silly but I'm sharing my solution anyway..... I wrote void OnFire(Input value){...} it is InputValue instead of just Input... At least I found it!! That's the bad part of studying at 3am...