I’m developing an XR game for Cardboard and trying to use onPointerObservable to trigger a pick. However, onPointerObservable doesn’t seem to work in XR mode. Is there a way to enable it or is there some other way to detect a touch in XR?
Cardboard is a strange bird in that it supports touch events to trigger certain actions, but was never expected to use touch for picking, especially since you don’t really know what (or where) exactly you are touching.
Are the events not triggered at all, or is picking not working?
If possible and fits the use case, you can force the gaze mode to allow user interactions with the scene
Probably not the issue, especially since ios doesn’t support WebXR at the moment
The issue here is the lack of controller support for cardboard, which in turn prevents the pointer selection feature to translate actions to pointer events. I’ll wait for Carl’s answer before I can help further, especially the only regarding whether or not the pointer events are being triggered and not picking or not triggered at all.
Ah, yes. I suspect that “strange bird” doesn’t begin to cover it. I’d forgotten that cardboard used to use a magnet to trigger. Does it still, or does it use touch?
Anyway, the “off-brand” cardboard I’m initially targeting uses touch.
I’ve tried using canvas.addEventListener("touchend", handleEnd, false); which doesn’t work in XR either. So, it looks like it’s a browser support issue and nothing to do with Babylon. Anyone know why?
FWIW touch is not being triggered at all. So, I may use gaze or move onto Gear. I have a Daydream, too. No idea if it’s still supported. The joys of developing on the cutting edge, I suppose. I just wish I was getting paid for all this soul-crushing effort!
I just checked browser support for WebVR and WebXR on caniuse. Oh. Oh my.
WebXR is the way to go, don’t trust webvr to work anywhere except firefox (which already has webxr support behind a flag).
I assume the touch events are not triggered because it is actually not being rendered in the browser but in some google VR bridge. There is sadly little we can do about it. Just to try - can you see if the “select” event is triggered?