Oculus ID return 0 and Username is empty
Hello, We require to get the Display name and Username for unique identification of our devices as they are logged in with specific Oculus account. I have setup an account on Oculus developer dashboard as required as well as doing all the certifications and requirements > data use checkup. The code in the Game Manager class is as follows public bool InitOculus() { try { Core.Initialize(123****132); Users.GetLoggedInUser().OnComplete(LoggedInUser); } catch (UnityException e) { Debug.LogException(e); UnityEngine.Application.Quit(); } return true; } void LoggedInUser(Message msg) { string name = ""; string username = ""; if (msg.IsError) { Debug.LogError("Failed to retrieve Oculus user."); } else { User user = msg.GetUser(); ulong userId = user.ID; Debug.Log("USER ID IS " + userId); //ImageURL = user.ImageURL; username = user.OculusID; Users.Get(userId).OnComplete(message => { if (!message.IsError) { name = message.Data.DisplayName; } else { var e = message.GetError(); Debug.LogError($"Error loading display name: {e.Message}."); } }); } Debug.Log("Display Name " + name + " and the username is " + username); } I am posting here because there are some other posts regarding this issue but they are either too old to be valid or unanswered. Thank you in advance.513Views0likes0CommentsHow do I integrate teleportation prefab with Netcode
I'm doing a multiplayer project using Unity Netcode. I'm using the LocomotionControllerInteractorGroup prefab to handle the teleportation, and there is a script from the SDK called PlayerLocomotor that changes the player position. Based on the Netcode tutorial, I should handle movement through NetworkBehavior rather than MonoBehavior, so I duplicated the script and changed it to a NetworkBehavior script, but the modified one is not functioning at all. I attached the modified script below. Could someone give me some hits about how to integrate the locomotion prefab into the NetworkBehavior, please? using System; using System.Collections; using System.Collections.Generic; using Oculus.Interaction; using Oculus.Interaction.Locomotion; using Unity.Netcode; using UnityEngine; public class RPCPlayer : NetworkBehaviour, ILocomotionEventHandler { // Start is called before the first frame update [SerializeField] private Transform _playerOrigin; [SerializeField] private Transform _playerHead; private Action<LocomotionEvent, Pose> _whenLocomotionEventHandled = delegate { }; public event Action<LocomotionEvent, Pose> WhenLocomotionEventHandled { add { _whenLocomotionEventHandled += value; } remove { _whenLocomotionEventHandled -= value; } } protected bool _started; private Queue<LocomotionEvent> _deferredEvent = new Queue<LocomotionEvent>(); protected virtual void Start() { this.BeginStart(ref _started); this.AssertField(_playerOrigin, nameof(_playerOrigin)); this.AssertField(_playerHead, nameof(_playerHead)); this.EndStart(ref _started); } private void OnEnable() { if (_started) { //this.RegisterEndOfFrameCallback(MovePlayer); //It's not available to the NetworkBehavior MovePlayer(); } } private void OnDisable() { if (_started) { _deferredEvent.Clear(); //this.UnregisterEndOfFrameCallback(); } } public void HandleLocomotionEvent(LocomotionEvent locomotionEvent) { _deferredEvent.Enqueue(locomotionEvent); } //[ServerRpc (RequireOwnership = false)] private void MovePlayer() { while (_deferredEvent.Count > 0) { LocomotionEvent locomotionEvent = _deferredEvent.Dequeue(); Pose originalPose = _playerOrigin.GetPose(); MovePlayer(locomotionEvent.Pose.position, locomotionEvent.Translation); RotatePlayer(locomotionEvent.Pose.rotation, locomotionEvent.Rotation); Pose delta = PoseUtils.Delta(originalPose, _playerOrigin.GetPose()); _whenLocomotionEventHandled.Invoke(locomotionEvent, delta); } } private void MovePlayer(Vector3 targetPosition, LocomotionEvent.TranslationType translationMode) { if (translationMode == LocomotionEvent.TranslationType.None) { return; } if (translationMode == LocomotionEvent.TranslationType.Absolute) { Vector3 positionOffset = _playerOrigin.position - _playerHead.position; positionOffset.y = 0f; _playerOrigin.position = targetPosition + positionOffset; } else if (translationMode == LocomotionEvent.TranslationType.AbsoluteEyeLevel) { Vector3 positionOffset = _playerOrigin.position - _playerHead.position; _playerOrigin.position = targetPosition + positionOffset; } else if (translationMode == LocomotionEvent.TranslationType.Relative) { _playerOrigin.position = _playerOrigin.position + targetPosition; } else if (translationMode == LocomotionEvent.TranslationType.Velocity) { _playerOrigin.position = _playerOrigin.position + targetPosition * Time.deltaTime; } } private void RotatePlayer(Quaternion targetRotation, LocomotionEvent.RotationType rotationMode) { if (rotationMode == LocomotionEvent.RotationType.None) { return; } Vector3 originalHeadPosition = _playerHead.position; if (rotationMode == LocomotionEvent.RotationType.Absolute) { Vector3 headForward = Vector3.ProjectOnPlane(_playerHead.forward, _playerOrigin.up).normalized; Quaternion headFlatRotation = Quaternion.LookRotation(headForward, _playerOrigin.up); Quaternion rotationOffset = Quaternion.Inverse(_playerOrigin.rotation) * headFlatRotation; _playerOrigin.rotation = Quaternion.Inverse(rotationOffset) * targetRotation; } else if (rotationMode == LocomotionEvent.RotationType.Relative) { _playerOrigin.rotation = targetRotation * _playerOrigin.rotation; } else if (rotationMode == LocomotionEvent.RotationType.Velocity) { targetRotation.ToAngleAxis(out float angle, out Vector3 axis); angle *= Time.deltaTime; _playerOrigin.rotation = Quaternion.AngleAxis(angle, axis) * _playerOrigin.rotation; } _playerOrigin.position = _playerOrigin.position + originalHeadPosition - _playerHead.position; } #region Inject public void InjectAllPlayerLocomotor(Transform playerOrigin, Transform playerHead) { InjectPlayerOrigin(playerOrigin); InjectPlayerHead(playerHead); } public void InjectPlayerOrigin(Transform playerOrigin) { _playerOrigin = playerOrigin; } public void InjectPlayerHead(Transform playerHead) { _playerHead = playerHead; } #endregion }1.4KViews1like1CommentOpenXR and Meta XR SDK at the same time
When I install OpenXR Plugin alongside Meta XR All-in-One SDK I get this warning in Project Validation to use Oculus XR Plug-in instead of OpenXR. What is the recommended/correct approach to achieve cross-platform compatibility with OpenXR while using Meta XR SDKs in that case? Or should I ignore this warning?1.6KViews3likes0CommentsOpenXR + Oculus SDK (Windows) ?
Hi, I have already developed a C++ app using Oculus SDK & OpenGL and would like to add eyetracking and handtracking to it (for Meta Quest Pro using Quest/Air Link). How could I process ? 1 - can I add eyetracking and handtracking extension using OpenXR without doing any rendering in it (keeping rendering done with Oculus SDK) ? 2- or must I convert the rendering process to do it via OpenXR ? I hope you can help me.1.3KViews1like0CommentsOVRPlayerController not working - Hands moving with Camera
I have been at this issue for over a week and I have seen similar posts on the forum that have been left unanswered so please if anyone knows how to solve it kindly let me know how. I'm using OculusInteractionSampleRig and onto it I added as a child or even attempted into the parent folder the OVRPlayerController and all the other necessary components such as Character COntroller, OVR Scene Sample Controller, OVR Debug Info, Character Camera Constraint and mapped the OVRCameraRig. However, when doing so the controllers work fine but the hand prefabs show up in the incorrect position and also move along the camera as I tilt my head or rotate around. This is an Oculus issue as even using the Locomotion Sample scene by Oculus themselves, the controllers are in the correct position but the hands aren't. Kindly find some screenshots of the setup. I really need the OVRPlayerController to work for my school project.2.9KViews1like2CommentsLibOVR is not a valid Win32 application
I downloaded the Oculus SDK from here Downloads - Oculus SDK for Windows. However, the Oculus World demo project does not run in VS2022 and gives the error that Unable to start program LibOVR.lib, LibOVR.lib is not a valid Win32 application. This demo project builds but does not run. How do I make it run to test the demo application?1.8KViews0likes2CommentsUpdate project in QT 5.4.1 from Oculus DK2 to Oculus RiftS
Hello, I am having trouble updating a project in QT 5.4.1 to use the Oculus RiftS instead of DK2. I already installed the new Oculus SDK, but then I am getting syntax errors in the mainwindow.h (.cpp) and ovrinterface.h (.cpp). If I try the old (year 2012) Oculus SDK's the RiftS is not initilized. Which is clear, because there is no RiftS in the old OVR_Capi.h. Is it even possible to quickly add the Oculus RiftS, or do I have to change the whole project? Maybe some of you have an advice where to start? Thank you!! G0071KViews0likes0CommentsPlease create more Oculus SDK Blueprints
Please work with Unreal and implement more Oculus SDK features as Blueprints for Unreal. Things like VoIP, Oculus Avatar integration, inviting friends to sessions/joining friend sessions, and other SDK/OSS features. This would really kickstart a lot of development teams in creating multiplayer VR games using Oculus Sub Systems and SDK features. If there is any news on this topic an Oculus Dev can share or any ETA for new BPs etc. I'd love to hear it:)1.7KViews4likes5CommentsIs it possible to use Oculus SDK with a game published on steam?
Hi, I've developed a game with Unity3D that uses oculus sdk to perform entitlement check. My game also uses oculus sdk's social and matchmaking api. I've successfuly published my game on oculus store and now I would like to publish it on steam, so i've send the build that passed on oculus store to the steam team so they can review it. The review result says they can't test it any further because the entitlement check fails. So is it possible to use Oculus SDK with a game published on steam?1.4KViews0likes3CommentsHaving Teleporting Issues with Locamotion Teleport
This is my first time using a teleport system with Oculus SDK. I'm having a few issues: 1) When teleporting, the PlayerController moves. This is fine in a sitting or standing game, but mine allows the user to move around within the room. When not in the starting position and I teleport, I end up very far from my teleport destination. After looking at the code for a bit, it appears that the camera itself is not being reset back to the starting position. So Im ending up far away if the camera is far away. Is there anyway to reset the CenterEyeAnchor on teleport? Or what do people do with this? 2) How do I stop being able to raycast through walls? Thanks!810Views0likes0Comments