MozillaReality / unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
https://mixedreality.mozilla.org/unity-webxr-export/Build/
Apache License 2.0
622 stars 127 forks source link

What is the best way to know if the current device has controllers? #421

Closed NikoGirardelli closed 3 years ago

NikoGirardelli commented 4 years ago

Hello,

First of all, thanks for this amazing exporter, I'm pleased with the result so far!

I'm having issues with how I could retrieve information about the current controllers being used. I want to activate my gaze logic if we discovered the player doesn't have controllers. So far my solution was to check with XR but I get some errors on my build. I know that's the problem since I get a functional build without this script enable.

////////////////////////////////////////// Beginning of the script ///////////////////// using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR;

/*

image image image

Thanks for the help, Niko Girardelli

NikoGirardelli commented 3 years ago

Fix it by not using the FixedUpdate and refractoring the code a little bit.