-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hit test support #33
Comments
Hey! I was testing Hit Test on iOS with great success but it seems to not work properly on Android. Any idea? EDIT: Remote debugging gave me the following error "PROD-BUILD.framework.js:92 Uncaught (in promise) DOMException: Failed to execute 'requestHitTestSource' on 'XRSession': Hit test feature is not supported by the session. |
Hi! This means your browser doesn't support hit test. But I should test that XRSession contains requestHitTestSource to warn if this feature is not supported |
Technically, the browser should support it. I tested it with Chrome 96.0.4664.92 (Android). E.g. testing it through this works fine in the same browser: https://chromestatus.com/feature/4755348300759040 |
One thing I found: According to several resources, it seems that it is required to ask for hit-testing when starting the AR Session: https://developer.mozilla.org/en-US/docs/Web/API/XRSession/requestHitTestSource So maybe (that's just a guess because I can try it earliest in the evening) that line 575 (SimpleWebXR.jslib) needs to be changed to require the hit-test module:
|
Okay, I was able to test it in the meantime and the solution from above worked now! I have a different issue now in regards of Unity's Input.Touch system. I'm not getting any errors in the console but I think this is related to the full screen. |
You are right, from now on, the hit-test feature shoul be declared, I'll add that here : Simple-WebXR-Unity/com.rufus31415.simplewebxr/Runtime/Plugins/WebGL/SimpleWebXR.jslib Line 575 in a906041
Thanks On Android, I know that for safety, in full screen mode, a new context is created and I'm not sure if Input.Touch which reacts on javascript events on the still works.
The only way to access the touch during a session is through the WebXR API with events InputSourceSelect , InputSourceSelectStart , ... |
Thanks for the quick response! |
If you use it with MRTK, WebXR events are propagated to MRTK core. So you just have nothing special to do except choosing your input source in MRTK settings |
I cant touch my ui button and 3d collider when in AR mode fullscreen, so i cant have any interaction after AR start. any example to fix this? |
https://immersive-web.github.io/hit-test/
The text was updated successfully, but these errors were encountered: