Grid Intercept the button's onPointerClickObservable in vr mode?

var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
var gd = new BABYLON.GUI.Grid();
advancedTexture.addControl(gd);
var sendBtn = BABYLON.GUI.Button.CreateSimpleButton(“sendBtn”, “send”);
gd.addControl(sendBtn,0,1);
This code,button can’t be click in Vr mode ,

var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
var sendBtn = BABYLON.GUI.Button.CreateSimpleButton(“sendBtn”, “send”);
advancedTexture .addControl(sendBtn,0,1);
This code,button can be click,
I think Grid Intercept the onPointerClickObservable so i can’t click the button

https://www.babylonjs-playground.com/#UU7RQ#383

Sorry not sure to understand the problem. I can click on both buttons so far

When the grid addControl button, you can click the button in vr mode ??Can you give me a demo?

You just need to use the vrExperienceHelper and turn on vrHelper.enableInteractions():
https://doc.babylonjs.com/how_to/webvr_helper#gaze-and-interaction

I add this code but still unuseful,In Vr mode ,My Controller’s Ray accross the gui,the end of Ray is not in the gui so my click is unuseful.

Can you repro in the playground? Maybe @RaananW or @trevordev can have a look then?

1 Like

https://www.babylonjs-playground.com/#GM1XMV#3 you can use this demo to test。

@1113 the issue seems to be that you are using a fullscreenUI element. You need to use a texture ui element as seen here https://www.babylonjs-playground.com/#TAFSN0#2

1 Like