Hi All,
I’m still pretty new to Unity, so sorry if I just missed something and this is not an actual issue, but I noticed some weird behavior with UI Toolkit. So I’m implementing a game and already created a few UI-s with UI Toolkit (menus, so far). There’s also a Pause overlay menu in my game. Its container game object is not disabled, only the UI itself is hidden, so basically the overlay is always loaded, it’s just invisible. Turned out, in the built game (within editor the issue is not reproducible), when the player hits the space key, the scene kind of restarts. After some digging around I noticed that there are a few classes within UI Toolkit’s library containing “listeners” for the space key, so I turned off the overlay game object, recompiled the game, and the issue went away. Afterwards I tried if anything happens when the overlay is actually shown, and the same happened, the scene restarted on hitting the space key. What makes it even weirder, as I mentioned, the issue is not reproducible within the editor. I know I can get rid of the issue if I actually disable the game object when it’s not needed, but when the overlay is visible even an accidental space hit can restart the scene now.
Any ideas, suggestions? Did I just miss something or is it an actual issue? Thanks in advance for your help!
Some further info:
- Unity version: 2020.3.12f1
- UI Toolkit version: 1.0.0-preview.16
- UI Builder version: 1.0.0-preview.17
- Build target: Windows x86_64
- Running on Windows 10 Pro 21H1