Comments (9)
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.
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.
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.
It sounds weird. Are you sure you don't have existing cameras in those scenes?
from unity-webxr-export.
Sure. Upload a project (preferably a fork of this repo), and I'll check it
from unity-webxr-export.
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.
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.
Sorry, but I didn't get to check it yet. Did adding the Destroy
method on Awake
solves the issue?
from unity-webxr-export.
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)
- Bug: "TypeError: Module._malloc is not a function" when entering VR mode HOT 4
- Apple Vision Pro - No select start/end event on hand pinch
- Spectator Camera is stretched
- Touch input mobile HOT 2
- Add an option to set flat/normal mode camera pose when returning from XR mode
- Bring back Built-in Render Pipeline support, an option to disable the use of XR Display
- Issues when using TrackedPoseDriver of the Input System
- Change "WebXR Export requires Gamma Color Space" to a warning and not an error. HOT 5
- WebXR Export + Unity XR Interaction Toolkit - I can't get more than 45 FPS with oculus quest 3. HOT 9
- Microsoft Mixed Reality with WebXR HOT 7
- LogError in OnPostProcessAllAssets preventing build HOT 2
- UI Canvas doesn't showed when it is configured as [Screen Space - Camera/Screen Space - Overlay] in AR mode (Android) HOT 2
- WebXR Interactions 0.22.0 - Performance differences between samples scenes HOT 3
- Implement WebXR Layers
- Streching of the view and no stereo vision HOT 2
- One stretched view in XR mode on headsets in Unity 2022.3.21f1 HOT 1
- Left and Right camera in Quest 2 look like missed allign and VR effect is broken. HOT 10
- Bug : TypeError: Module.dynCall_viffffffff is not a function at Module.WebXR.Onstart at XRManager.animate at XRSession.tempRaf HOT 3
- Meshes not rendering at VR browser HOT 10
- Trigger and Grip button on Oculus did not working HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-webxr-export.