Oculus didn't update the 'learning samples' to 4.24, a lot of stuff is deprecated...
Now instead of learning from it, (and making use of it) I have a week or more of just trying to get it working (a week is an eternity to a solo developer who works 18 hour day :o) I'll just post an image. Help most welcome. I was trying to do the right thing and R.T.F.M but the F.M is not updated! Thank you for any help!751Views2likes1CommentOculus Headset movement
I want to know how can I change in unity the thershold of the method below: transform.haschanged At the moment it is so sensitive and it triggers with 0.00001 change in the camera. We have created an Interactive VR video in unity and we want that everytime the user doesnt use the oculus for 30 seconds, a trailer video starts to play! We have created the code below but even when the oculus is on the ground, still moves a bit (too sensitive): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Video; public class Trailer : MonoBehaviour { public int timeOut; private int timeOutTimer = 0; private Quaternion gameObjectrotation; private VideoPlayer videoPlayer; public float dynamicRange = 100f; // Use this for initialization public void Awake() { Vector3 lastPos; videoPlayer = GetComponentInParent<VideoPlayer>(); gameObjectrotation = Camera.main.gameObject.transform.rotation; InvokeRepeating("ScreenSaver", 0, 1.0f); } public void ScreenSaver() { timeOutTimer++; var wMinus = gameObjectrotation.w - dynamicRange; var wPlus = gameObjectrotation.w + dynamicRange; var xMinus = gameObjectrotation.x - dynamicRange; var xPlus = gameObjectrotation.x + dynamicRange; var yMinus = gameObjectrotation.y - dynamicRange; var yPlus = gameObjectrotation.y + dynamicRange; var zMinus = gameObjectrotation.z - dynamicRange; var zPlus = gameObjectrotation.z + dynamicRange; var cameraW = Camera.main.gameObject.transform.rotation.w; var cameraX = Camera.main.gameObject.transform.rotation.x; var cameraY = Camera.main.gameObject.transform.rotation.y; var cameraZ = Camera.main.gameObject.transform.rotation.z; if (cameraW >= wMinus && cameraW <= wPlus && cameraX >= xMinus && cameraX <= xPlus && cameraY >= yMinus && cameraY <= yPlus && cameraZ >= zMinus && cameraZ <= zPlus && timeOutTimer >= timeOut) { //Show video videoPlayer.gameObject.SetActive(true); videoPlayer.Play(); } else { //Hide Video videoPlayer.gameObject.SetActive(false); videoPlayer.Stop(); videoPlayer.frame = 1; } if (cameraW > wPlus || cameraW < wMinus || cameraX > xPlus || cameraX < xMinus || cameraY > yPlus || cameraY < yMinus || cameraZ > zPlus || cameraZ < zMinus) { timeOutTimer = 0; } gameObjectrotation = Camera.main.gameObject.transform.rotation; } } Any help would be appreciated! Cheers480Views0likes0Comments