Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

InputSystem UI Input Module empty on play

Discussion in 'Input System' started by kqmdjc8, Mar 17, 2021.

  1. kqmdjc8

    kqmdjc8

    Joined:
    Jan 3, 2019
    Posts:
    102
    I am creating a co-op UI for two players using new Unity's input system. The problem is that when I press play it creates a copy which is empty and actions do not work:
    - I do not reference this script in any other script.
    - switching Player1 to Keyboard/Pad does not make a difference.
    - re-making an entire Canvas and reassigning all of the values doesn't work as well.

    Player2 seems to work just well. What could be the problem?

    Screenshots for better understanding:

     
  2. kqmdjc8

    kqmdjc8

    Joined:
    Jan 3, 2019
    Posts:
    102
    I have also tried re-assigning ActionsAsset through a script which succeeds, but the actions are erased anyway.

    Code (CSharp):
    1.     [SerializeField]
    2.     private InputActionAsset inputActionAsset;
    3.  
    4.     private void Start()
    5.     {
    6.         inputModule = GetComponent<InputSystemUIInputModule>();
    7.         inputModule.actionsAsset = inputActionAsset;
    8.     }


    I really don't want to reassign all of the actions through the script :(