mathias_strasser Posted December 3, 2016 Share Posted December 3, 2016 I wrote a babylon.js scene and played it on a Google Pixel with a Daydream headset using a Cordova wrapper. I'm stuck now because my scene actually consists of a few different scenes through which the user needs to click. Is there any way I can recognize user actions in my script? The Daydream controller is of course very new and so there's no Cordova plugin for it (nor is there for the Gear VR). I tried to register an onPickTrigger action but that doesn't work - and not even a simple global canvas.onclick event gets noticed. Is it just not possible in HTML5 VR apps to register user actions or am I missing something obvious? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 4, 2016 Share Posted December 4, 2016 Hi @mathias_strasser, welcome to the forum. Would you have a moment to try a canvas.parentNode.onClick event? In the playground, the canvas container is ID: canvasZone. I'm not experienced in the Daydream Controller, but, JS events is JS events. Anyway, here is a little helper doc for Daydream Controller events. https://developers.google.com/vr/unity/controller-basics It looks like the Daydream Controller uses some unique event names. Perhaps try adding event listeners for those unique names? Quote The controller reports the following button properties: ClickButton: True if the Click button (a touchpad click) is currently being pressed. ClickButtonDown: True for 1 frame after user starts pressing the Click button. ClickButtonUp: True for 1 frame after user stops pressing the Click button. AppButton: True if the App button is currently being pressed. AppButtonDown: True for 1 frame after user starts pressing the App button. AppButtonUp: True for 1 frame after user stops pressing the App button. *shrug* I'm not sure HOW BJS is going to proceed in dealing-with the 10,000 new controllers that will be invented in the near future. I once proposed that all user inputs enter BJS land through an "Inputs ActionManager" class, but that idea was met with some less-than-optimal enthusiasm. (That is common for me... I am a professional at thinking-up half-baked/ridiculous ideas.) heh Anyway, perhaps others will comment with more info. Don't expect miracles, because you are riding WAY UP on the "bleeding edge". Be well, welcome again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.