In build, callbacks on inputs not working due to addressable

[Gotcha] : Audio Mixer in addressable assets just added the input map as an addressable and it fixed the non working callbacks.

I did a very thorough debugging session so I hope I’ll hear an official answer. I believe it echoes to several other issues stating that inputs are broken in build. (2021 LTS + Input System 1.7)

Added Breakpoints on the following code and the last hit is an add with my callback

        public event Action<CallbackContext> performed
        {
            add => m_OnPerformed.AddCallback(value);
            remove => m_OnPerformed.RemoveCallback(value);
        }

After my .performed +=callback was called, the m_Perfomed Callback array holds the correct value.

Later in the execution path, probably on the next frame as it’s within an Update(), I check the value of m_Perfomed and it’s is empty in build and has the correct callback in editor.

Note :

  • The action is disabled when calling perfomed +=, it is enabled on this next frame, but shouldn’t be an issue.

Wondering :

  • Asset duplication in build ? So they are actually two different Map/Action ? (I check the m_Id of each and they are consistent.) The InputMap is not an adressable. But the GameObject enabling the action is in an adressable scene.

Depends on anything else that is referencing the input map. If you have a non-addressble asset point to the map, and also an addressable asset pointing to it, you will have duplicated assets. The Addressables Analyze window should be able to tell you if this is the case.

1 Like

It could be related even though some input following the same integration do work. I’ll have to give it a look.

I simply added the input action map to the main addressable group and it seems fixed.

I had the “luck” to already have had the same issue with the audio mixer and that someone knew it was adressable related : https://discussions.unity.com/t/817856