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

New Input system and Scene changing

Discussion in 'Input System' started by hardcodednumber, Nov 30, 2016.

  1. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    88
    So before I start describing my issue, the new input system works with an empty scene and my prefab.

    My current system is loading the level the user picks, and instantiating the prefab the user selects. When I press any key that corresponds to the horizontal axis input, the value returned is always zero. I started to debug the input system to see where the problem is. The KeyboardInputToEvents class does register the event for the key down, however; it fails when in ExecuteEvent when the s_EventTree tries to process the event. What is the event tree and why would it be failing?
     
  2. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    88
    So after more clicking and tying temp code, I found out the problem is that the prefabs that had the player input script on them, didn't have the action map checked for being enabled.

    Crazy thing is that in the Hierarchy the instantiated prefab had the check in the action map.

    Oh I understand what the s_EventTree is used for now.
     
  3. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Those checkboxes in the Inspector are for the initial enabled state. If an ActionMapInput is enabled/disabled at runtime, it will not (currently) be reflected in the Inspector though we are considering changing that.
     
  4. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    88
    Ah that would be helpful! Thanks!