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

Resolved NullReferenceException in InputActionMap.ResolveBindings in build only

Discussion in 'Input System' started by Krooq, Aug 11, 2022.

  1. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    194
    Hi all,

    I'm using the ne input system and have no issues in the editor.
    But when I create a build I get the following exception when I try to enable an action map.

    Has anyone seen this before? Why is this happening?
    I tried to inspect the code at the exception site but its all kinds of confusing and I don't think this ResolveBindings method should throw an exception.

    I'm in Unity 2021.3.7 with input system 1.3.0.
    I'm also using DOTS but can't really see how that's relevant.
     
  2. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    194
    Solution TL;DR, do all your action map setup and enabling at runtime and not in the editor XD
    This should have been obvious since how can it possibly know what control devices are being used at build time.