unity-webxr-export
unity-webxr-export copied to clipboard
Adding docs and how-to
There are no docs and tutorials about the different components and how to start a project or import the packages.
I think that creating a general docs folder at the root of the repo, and link from docs folders of the packages would be easier to maintain.
I'm having trouble accessing the WebXR namespace from scripts inside /Assets/
Would be good to get a guide on this.
Assets/myproject/PlayerController.cs(4,7): error CS0246: The type or namespace name 'WebXR' could not be found (are you missing a using directive or an assembly reference?)
with
using System.Collections.Generic;
using UnityEngine;
using WebXR.Interactions;
public class PlayerController : MonoBehaviour
{
public WebXRController leftController;
public WebXRController rightController;
}```
If you are using VSCode, it might be related to the VSCode package version, updating it to 1.2.3 (or up) should solve your issue.
It's a Unity bug, so I don't think that we should have a doc for it. You will get the same error for trying to use UnityEngine.UI
.
Your issue might also be related to the use of .asmdef
file. And while it's Unity related issue, this is something that should be in the docs. Thanks!
For now, developers who also has similar issue, I made a video tutorial about this - https://youtu.be/N9iACzNCnos
ah yes can confirm this, all working now
Adding to this, it would be really nice to have some more in-code comments in general. Especially on the functions and events in WebXRManager. For instance, I can't really wrap my head around the ViewerHitTest state. Guess it's related to this? And the XRChange event? what are those parameters? :octocat:
Ah, just realized you are moving the cameras rather than the objects during hittest-updates. Guess that's because of static bathing optimization 👍
Yes, should add more comments. Would be happy if others would be able to help with that.
Regarding the ViewerHitTest
, you can check the WebXR Interactions package for SceneHitTest
which is one way to use it.