-
-
Notifications
You must be signed in to change notification settings - Fork 996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI Pointer ignores Order by Layer #1846
Comments
Yeah! Totally vote for this |
Bug still exist, child reorder or reorder in general does not fix it. To Reproduce: This is also the case if more than 2 duplicates are made and are set behind in row. I also wrote @bddckr in the slack channel an he only pointed me at #982 and his solution at the end which is not working. And is claiming that it works for others just fine. |
The canvas is in front of the other (not just drawn in front), It clearly is a Unity issue as it appears without VRTK, but this makes it totally useless to have multiple canvases in world space if they cannot be used as intended. |
I had the same problem and solved it this way:
|
@wdulot Would you share a minimal working example or scene setup? I tried your solution but the issue still remains. Edit: Removing the Sphere Collider from the generated ObjectInteractor object kind of worked, but is no suitable solution because then the pointer can't be used for interaction with other objects. Also, it is autogenerated. |
@finartist I only use pointers to interact with UI so this works for me. |
@wdulot Thank you. Your solution might not help in my case but might help others :) At least, it is a new fact to consider while investigating. |
Strange things are going on. I added a debug log to |
It seems, that the problem lies in the ray used to test the graphic elements in the GraphicsRaycaster (or here in the |
So I could trace the problem down down and make it work for me. I will describe briefly, where you need to add lines of code and why the problem occurs in the first place. I think it is not a great solution and might break in some cases. Still, you might want to try this until there is a better solution. Why does it happen? How to repair it
With this, you still get the current raycast target because the nearest one is the first in the list. I still have issues with images that should block underlying elements but at least it does not shoot through canvases anymore. I haven't tested it throughoutly yet so there might still be issues with it. |
@finartist's fix worked for me, without doing the custom sort. |
Closing this as it's related to an older version of VRTK (v3.3) the master branch is now on VRTK v4. Feel free to request to reopen if the issue is still present. |
Environment
Steps to reproduce
Expected behavior
The UI Pointer would hit the front most canvas, allowing clicks on the buttons. The pointer renderer hits the same canvas. Placing the canvas with 100 behind the others would still force the UI Pointer to pick that one over the others according to the solution specified in #982 and #1609.
Current behavior
The UI Pointer hits the elements of the last canvas instead of the canvas closest to the controller.
The pointer renderer hits the front most canvas. The canvas with layer 100 always renders on top, even when put behind the other canvas but is not hit by the UI Pointer.
The text was updated successfully, but these errors were encountered: