I can’t use the pick element function of the UI Toolkit Debugger when the game is in “16:9 portrait”. It works fine in “free aspect” and in the “??? x ???” modes. It doesn’t work only in the aspect ratio “??:??” modes.
By “can’t use”, I mean it displays this :
I was going to make a post on this myself - the issue seems to be that the “GameView” selection in the dropdown. In your dropdown there is going to be something called “PanelSettings” or “GameViewSettings” or some combination of a word with “Settings” a the end. Selecting that will actually show the game view markup and allow the element picker to work.
Here’s some screenshots of two instances of Unity I had open where I had to select these panels manually to get the GameView markup to show in the debugger:
Unity instance #1:
Unity Instance #2
Instance #1 always uses PanelSettings, and Instance #2 always uses GamePanelSettings.
I didn’t notice the 16:9 thing, but you are right - in “Free Aspect” it works ok with the GameView panel (to be clear, it’s not just 16:9 - anything other than “Free Aspect” has this issue). What’s interesting is that it works in “Free Aspect” because when you select an element, it flips back over to "GamePanelSettings’! So there must be a bug that when not using “Free Aspect”, the element picker isn’t flipping back over to that (but works if you select it manually in advance).
To complete this comment, the combination of words is actually coming from the name given to the panelSettings linked to the UI Document.
I would not be surprised if the picking of the debugger only consider the first panel on screen, and it would be a nice improvement to the code to pick on the currently selected panel instead, but the aspect ratio should not have any impact on the picking.
@vejab Could you file a bug for this with some clear reproductions steps as some fixing need to be done for the aspect ratio!
You could try filling a bug for the other, but it may be marked as a “future improvement”/by design. It will be prioritized along other potential new features, and I time some time as other interesting features will possibly take precedence.
I’ve filed the bug here : https://fogbugz.unity3d.com/default.asp?1412657_u2sj7slh8i39o360
It’s exactly as @Spectragate says. The game is actually in “PanelSettings” but in my case, in aspect ratio, the debugger switches to “GameView”. If I manually switches back to PanelSettings, I can see my visual elements.
But why is it name PanelSettings in the first place? it’s pretty confusing
The runtime panels are created dynamically, and they take the name of the panelSettings used to configure them. The default one is called “PanelSettings”, if I am not mistaken. The debugger display the name of the panel. You can rename the asset in your project folder to change the name in the debugger.
Ah ok, I didn’t know that’s where the name come from
Got this answer from Unity