08-07-2024 04:39 AM - edited 08-07-2024 04:41 AM
Hi,
How do I manage disabling and enabling multiple world space canvases so the Ray interactions work properly, when the canvases are placed in front of each other?
The UI canvases are default Unity world space canvases with ray interactions added with the quick actions described in this article: Add an Interaction with QuickActions | Oculus Developers
The problem is that I have two worldspace canvases with ray interactions placed in front of each other, kinda like in layers. When I disable the canvas gameobject in front, the interactor cursor hits the disabled (invisible canvas) and does not properly pass through to hit the second canvas (which it should do).
How can I ensure the cursor interacts with the first active/visible canvas and does not get captured by disabled ones?
12-03-2024 12:37 PM
Hey, did you get anywhere with this?
12-05-2024 03:39 AM
Hey, @SpanishDave
We would recommend contacting our developer support for extra help with this issue.
You can get in touch with them here: https://developers.meta.com/horizon/support/
12-05-2024 06:22 AM
I made myself a prefab that contains an empty object and a canvas and collider nested in it. Accordingly, when I turn off the object, the collider and canvas are turned off.
12-07-2024 05:39 AM
I'm not saying this is a definitive solution, but here is what I did.
Setup a parent canvas go with all canvas components, graphic raycaster, pointable canvas and ray interactable scripts in the inspector. This canvas is empty (has no UI elements). Setup ISDK_RayInteraction (Right click gameobject -> Interaction SDK -> Add Ray Interaction to Canvas). This is your interactable canvas.
Setup your canvases as children of the parent you have just made. Make sure they do not have any XR components, like pointable canvas/ray interactable scripts, or ISDK_RayInteraction. Set them up as you would normally.
You should then be able to add UI elements to your child canvases and all should all be interactable.
Hope this helps someone!