How to create interactive GUI button for 'immersive-ar' sessionMode

Cant click on GUI button created using BABYLON.GUI.Button.CreateSimpleButton in Webxr ‘immersive-ar’ sessionMode mode .

Interesting. I can reproduce this, but am 100% sure it was working before. I must have broken something :slight_smile:

Want to submit a github issue?


Yeah , I will submit the issue.

hi, bit of a bump… wondering if there’s a solution for this yet (I’ve just run into the same issue).

1 Like

This will be taken care of this week.

1 Like

Wanted to update here - this PR - [XR] pointerX and pointerY update in XR by RaananW · Pull Request #9087 · BabylonJS/Babylon.js · GitHub , once merged, will solve the issue.

Hi Jedi @RaananW ,
Encountered with the same issue.
saw that the

Cant interact with GUI.Button.CreateSimpleButton in WebXr immersive-ar mode. #8879

is merged.

The specific scenario that I’m using is that since in Oculus Quest the BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI is showing the UI twice (not aligned for each eye lens), I found that linking it to a TranformNode fixed the double vision issue inside the Quest.
So I’m trying to point and click the button, that is a child of GUI.StackPanel which is linked to a node, but it does not show that the pointer reaches the button ( and an additional slider GUI child control as well ) and the event is not triggered.
This scenario makes sense to you ?

Thank you very much

Additional information that might help,
After trying to further investigate the issue, I was just able to click the button in random pointing directions in the VR space inside the Oculus.
It was mostly under the button but in a specific angle and rotation of the controller I manage to hit it directly on the button itself.
But again, mostly it was under and some of it were up from the button and slider inside the StackPanel.
Hope it will help somewhat.

Hi @RaananW, Guys,
I assume that not being able to have at all BABYLON.GUI controls in a VR device is a big issue.
Should I submit a github issue ?
What should I do in order for it to be addressed as a major bug ?
Can I help with the coding helping to solve this problem?

appreciate any information

Of course it is, but it is not the case :slight_smile:

We don’t support fullscreen UI when in XR (yet), there is an open issue for that. I will address it once I clear some time for it.
Other UIs, like those that are attached to a mesh that is in front of you, should work as expected. Note that the object needs to be further away than your controllers, otherwise the rays won’t detect them.

If you want to share a playground that you think should work but isn’t, i’d be happy to debug it with you.

You are the best man,
I was able to overcome this while using BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh instead of BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI.
The double vision of GUI elements in Fullscreen still needs to be fixed IMHO, but if there is an open issue for doing so then I am satisfied.
I will wait for it to be merged.
But at least now I can continue with my development.

1 Like

Fullscreen UI in XR will anyhow only be used to display information. You can’t click on elements that are right in front of your eyes.
This is why MRTK (for example) provides a set of 3D elements that can be added to your scene and doesn’t directly use a fullscreen UI.

Makes sense

1 Like