Giter Club home page Giter Club logo

Comments (9)

zer0grand avatar zer0grand commented on May 21, 2024 1

Yeah, tested it a few more times to make sure. I'll put up a demo scene on github pages soon as an example

from unity-webxr-export.

zer0grand avatar zer0grand commented on May 21, 2024 1

Here is the pages link: https://zer0grand.github.io/unity-webxr-export/index.html
Here is the repo: https://github.com/zer0grand/unity-webxr-export

I added a cube to the Desert scene. When the cube is touched by a hand, the scene switches to "Desert 1". This scene is the same as Desert with the only change being the skybox. Tested with a Vive on Firefox, the head tracking freezes (the hands still track).

On another note:
If you touch the cube in the "Desert 1" scene, it will take you back to the "Desert" scene, though it will create the duplicate camera glitch. While this second part isn't really a bug or the issue I'm referencing, it might be worth adding some type of singleton behavior to the camera rig. ex:

namespace WebXR {
public class XRCamera: MonoBehaviour {
public static XRCamera current = null;

void Awake() {
  if (null == current) {
    current = this;
  } else if (current != this) {
    Destroy(gameObject);
  }
}

}
}

(I can't figure out how to format that code with markup...) But this way there can't be duplicate XR camera rigs.

from unity-webxr-export.

zer0grand avatar zer0grand commented on May 21, 2024 1

Just did a little testing and figured out changing the "Awake()" function in "WebXRManager.cs" to this will fix the camera duplication thing:

private void Awake()
{
  Debug.Log("Active Graphics Tier: " + Graphics.activeTier);
  if (null == instance) {
    instance = this;
  } else if (instance != this) {
    Destroy(gameObject);
  }

  if (instance.dontDestroyOnLoad)
  {
    DontDestroyOnLoad(instance);
  }
  xrState = WebXRState.NORMAL;
}

from unity-webxr-export.

De-Panther avatar De-Panther commented on May 21, 2024

It sounds weird. Are you sure you don't have existing cameras in those scenes?

from unity-webxr-export.

De-Panther avatar De-Panther commented on May 21, 2024

Sure. Upload a project (preferably a fork of this repo), and I'll check it

from unity-webxr-export.

De-Panther avatar De-Panther commented on May 21, 2024

Thanks!

Regarding the singleton, yes, it should be in the WebXRManager.

I'm trying to think of a good way to generalize all the Rig, so it would be easier to implement it in current AR/VR rigs.
Would like to hear what you think.
Which XR APIs are you working with in general(Not for WebXR) to get the Camera and Controllers poses?

from unity-webxr-export.

zer0grand avatar zer0grand commented on May 21, 2024

What do you mean by generalize? Do you mean break it down into smaller prefabs that can create a rig when put together? I've been working on a hand interaction system that is more generalized, though not sure how much you would like it since it uses parenting instead of fixed joints.

Also when you say XR API do you mean the OVR Integration and SteamVR packages? I use those a fair amount but I've been using your exporter more recently because it is so much cooler/better to build stuff for the web due to accessibility.

from unity-webxr-export.

De-Panther avatar De-Panther commented on May 21, 2024

Sorry, but I didn't get to check it yet. Did adding the Destroy method on Awake solves the issue?

from unity-webxr-export.

De-Panther avatar De-Panther commented on May 21, 2024

Reading this issue MozillaReality/unity-webxr-export#423
I guess it's the same, and by the look of it, it might already fixed in this repo in #65

I'm closing this issue, as there wasn't a comment for a long time. If it still happens please comment.

from unity-webxr-export.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.