unity-webxr-export icon indicating copy to clipboard operation
unity-webxr-export copied to clipboard

Adding docs and how-to

Open De-Panther opened this issue 3 years ago • 6 comments

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.

De-Panther avatar Nov 28 '20 21:11 De-Panther

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;

}```

HawkenKing avatar Dec 10 '20 07:12 HawkenKing

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.

De-Panther avatar Dec 10 '20 08:12 De-Panther

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

De-Panther avatar Dec 10 '20 08:12 De-Panther

ah yes can confirm this, all working now

HawkenKing avatar Dec 10 '20 09:12 HawkenKing

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 👍

TheXRMonk avatar Apr 09 '21 12:04 TheXRMonk

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.

De-Panther avatar Apr 09 '21 20:04 De-Panther