Input not working on some scenes (builds only)

Hello everyone,

The problem is simple:
Every scene I create works flawlessly on editor and some scenes have this weird issue on builds that it doesn’t detect any input.

I have to create a new scene, and a new one, and another until it works on builds.

I already reported a bug 20 days ago (Case 1363191).

The thing is I’m making a Metroidvania and I need to create a lot of scenes every single day and it’s driving me nuts because instead of simply creating it and setting up the enironments on the editor, I have to create and debug them all on builds, almost 50% of the new scenes will not work, then I have to fix them, build again and it goes on and on.

Any clue of what might be causing this thing is valid.
I already tried a couple of things like deleting all scenes from build settings and messing around with scripts order but no luck.
Already tried updating unity since I’m running on a M1 macbook air, no luck too.

I’m running Unity 2021.1.19f1 and I have 0 compile errors / warnings.
I’m using the “new” Input System.

Thanks in advance.

What are you doing that fixes them?? If it fixes them, is it a Unity problem or are you neglecting some important step?

Also, all your main game input should really only be handled in one (or very few) scenes, then each of hundreds of scenes can be additively loaded only as a “content” scene, to avoid cloning effort between scenes.

This is how to use additive scene loading:

https://discussions.unity.com/t/820920/2
https://discussions.unity.com/t/820920/4

https://discussions.unity.com/t/824447/2

A multi-scene loader thingy:

https://pastebin.com/Vecczt5Q

My typical Scene Loader:

https://gist.github.com/kurtdekker/862da3bc22ee13aff61a7606ece6fdd3

Other notes on additive scene loading:

https://discussions.unity.com/t/805654/2

Timing of scene loading:

https://discussions.unity.com/t/813922/2

Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

Two similar examples of checking if everything is ready to go:

https://discussions.unity.com/t/840487/10

https://discussions.unity.com/t/851480/4

Thank you for your super in depth reply!

  1. The fix is random - I need to create new scenes until one of them works on builds too…

I’ll check out everything you linked on your reply.
The way I’m handling my scenes is:
Each scene have basic prefabs:

LEVEL

  • UI
  • Game Manager
  • Global Light
  • Global Volume
  • Save Manager

PLAYER

TRIGGERS

  • Scene Loader
  • Dialogue Trigger
  • Save Trigger

And that’s it.

I create a new scene, than I drag those few PREFABS into it, I unpack the TRIGGERS because it’s used on different world spaces for each scene and I build the level on grids.

The game runs smoothly with no FPS drops anywhere, even where I have a lot of real lights and particles and this issue never happens on editor, it’s super weird.

Thanks again for your time, I’ll have a look on all the links you send and try to change some things.

Remember this possibility as well:

https://forum.unity.com/threads/nullreferenceexception-on-prefab-inside-scriptableobject-only-on-build.1176791/#post-7537982

Hmmmmmm, that’s interesting! Time to check out a lot of scripts

Thanks again!!

did you ever figure this out? I’m having the same problem