unity-webxr-export
unity-webxr-export copied to clipboard
WebXR AR Hit Test
The current WebXR API doesn't have implementation of plane/surface detection, but it does have Hit Test. To make the AR option useful, need to implement this hit test, so users would be able to position objects in the world.
With an example scene that allows the user to scale, move and rotate the object, please :D. Ideally, to look something like google's scene viewer
Could this be useful?https://github.com/immersive-web/real-world-geometry/blob/master/plane-detection-explainer.md
Hi, what's the status on this? It's trivial to setup in vanilla JS/WebXR, but have there been any hurdles for the layer in Unity?
@rogueyoshi currently there's Hit-Test with viewer(screen) center only. https://github.com/De-Panther/unity-webxr-export/pull/59
It's possible to implement hit test from other points of the screen, but I prefer to wait for Unity to add support for WebGL in the XR SDK, and implement it after that
@De-Panther well then... will you be PRing this back into the main repo? and do you know when Unity will be making XR SDK bindings?
I have no idea regarding Unity's plans for XR SDK WebGL support. But once there'll be, I plan to add this to this repo.
If I'll see that it takes them too much time, I'll probably add better support for this specific WebXR API.
Can you describe your use case? (It'll help to design the integration)
Being able to hit test from the center of the screen covers 90% of ordinary use cases, that I can think of. So that's a huge plus. What it omits for now, is the ability for the user to tap certain areas of the screen, and have hit detection fire from that x/y on events such as ontouchstart, ontouchend, etc - this would be useful for stylizing the ux of certain types of ar games and experiences.
imagine a farming simulator where the player wants to plant seeds in the ground. rather than having them direct the center of the screen to each coordinate where they would like to plant the seed, they simply tap the screen, and the seed is planted.
most actual use cases could be engineered around the limitation of only having centered hit testing, but it might be a less fluid ux experience
I'm struggling to figure out how to use the hit testing implemented here. The sample scene does not seem to do anything despite having the SceneHitTest code present.
I have been hassling myself with this package, for the last week, and it's not pleasant to work it on AR, information is scarce, and somewhat quickly written. and the info we have is majorly related to VR.
EDIT : ( I lack the knowledge to talk about this system and i didn't want to confuse anyone, that's why I edited this comment) Thanks for making this incredible plugin available to everyone.
Please don't confuse others just because you don't know something.
SceneHitTest works as usual, and if you follow the getting started guide it'll work as it should. Combining different versions of parts of projects by copy pasting with no understanding how Unity's assets system works, usually break them, as you describe happened to you.
Documentation is lacking, true. If you must have documentation and can't figure out how to work by using the code and samples, this project is not for you.
My apologies I wasn't trying to confuse anyone, I may try to improve my understanding of this. I'm sincerely sorry.