yasirkula / UnityIngameDebugConsole

A uGUI based console to see debug messages and execute commands during gameplay in Unity
MIT License
2.05k stars 218 forks source link

Console not closing using new input system #55

Closed biosmanager closed 3 years ago

biosmanager commented 3 years ago

Description of the bug

When using the new Unity input system, closing the console does not work when clicking the red cross. The steps to enable the new input system for this plugin were performed. Same behavior when having both input systems active without the modifications.

Reproduction steps

Trying to close the console overlay when using the new input system.

Platform specs

image

yasirkula commented 3 years ago

Does the close button change color when you press & hold it? Why are both the popup and the console window visible at the same time?

biosmanager commented 3 years ago
  1. Yes, it gets darker.
  2. That is my issue, it does not close properly.
yasirkula commented 3 years ago

I can't tell the issue with the current information I have. For example, I don't know if the popup appears after you click the close button or if it has always been there from the beginning, together with the console window. You should see either the popup or the console window at a time. And did you modify the plugin in any way? Can you reproduce the issue on a new Unity project with or without the new Input system?

biosmanager commented 3 years ago

When starting, the issue counter appears as normal and when I click on it, the console appears. But, when trying to close the console it does not work, instead the issue counter moves to the foreground and the console is still visible. The issue is present on a new Unity project when either only the new or the both input systems are active.

The bug also occcurs when I freshly install the plugin without any input system modifications. I just used the prefab.

yasirkula commented 3 years ago

Alright, I'll download 2020 LTS and see what causes the issue, then return back to you.

yasirkula commented 3 years ago

I couldn't reproduce the issue on a new 2020.3.8f1 project with or without the new Input System. I've imported only IngameDebugConsole from Releases page.

biosmanager commented 3 years ago

Interesting, could try also importing XR Plugin Management and OpenXR plugin? I will also again try it on a clean project without those and report back. I may had those accidentally enabled.

biosmanager commented 3 years ago

Ok, so the issue occurs as soon as I install the OpenXR package.

yasirkula commented 3 years ago

I still can't reproduce the issue. I'm testing the plugin in the Editor BTW. I'm guessing you're doing the same because you haven't mentioned testing the plugin with a VR headset so far.

OpenXR

biosmanager commented 3 years ago

Sorry, yes, I'm testing with SteamVR running in the background and a Valve Index attached. Whenever the OpenXR plugin is enabled (checked as in your screenshots), the bug occurs.

yasirkula commented 3 years ago

Can you change the canvas mode to Screen Space - Camera or World Space?

biosmanager commented 3 years ago

Nope, not feasible in this case. I need the debug UI on the flat screen to monitor any events while I conduct an experiment with participants in VR.

yasirkula commented 3 years ago

I'm suspecting that no camera is rendering to your Game view, so its color buffer isn't cleared every frame (or, there is a single camera with its Clear Flags set to Don't Clear). If I'm correct, then when you drag the popup around, you'll see the famous Solitaire effect:

img

I don't know if it is possible to clear the color buffer without using a camera. But it shouldn't really matter because you're only interested in seeing the logs and as long as the console window is open, you should see the logs without any major UI issues.

biosmanager commented 3 years ago

You are absolutely right: image

I see what the problem is, maybe I can find a fix and post it here for others which face similar issues. Thanks a lot so far!

biosmanager commented 3 years ago

Update: This only occurs, when SteamVR is running but the HMD is not actively rendering e.g. when the base stations are turned off. I suspect that in this case the camera view is not properly cleared.

yasirkula commented 3 years ago

You can try calling GL.Clear inside Update and see how it goes.