Forum Discussion
rfunk82
8 years agoExplorer
Getting my Oculus id (Username)
I'm trying to get my Oculus username (Unity, c#) so I can use it on my game, but unfortunately I'm getting an error message and I can't find a solution myself. My oculus works in the game,
The error message I get is:
I'm pretty sure I'm missing a step but I can't find it in the manuals.
This is what I did so far:
I imported using Oculus.Platform;
and then I tried:
I call:
Method in my class:
The error message I get is:
NullReferenceException: Object reference not set to an instance of an objectI'm pretty sure I'm missing a step but I can't find it in the manuals.
This is what I did so far:
I imported using Oculus.Platform;
and then I tried:
I call:
Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);Method in my class:
void GetLoggedInUserCallback(Message<User> msg) { if (msg.IsError) { Debug.Log("ERROR: " + msg); return; }
Debug.Log(" I am " + msg.Data.OculusID); }
3 Replies
Replies have been turned off for this discussion
- delphinius81Rising StarDid you initialize the platform by calling
Oculus.Platform.Core.Initialize();
first? - rfunk82Explorer
delphinius81 said:
Did you initialize the platform by callingOculus.Platform.Core.Initialize();
first?
Thanks! I knew I was missing something. Now I get a new error message from the debug error message I wrote (if (msg.IsError) ):ERROR: Oculus.Platform.MessageWithUser
UnityEngine.Debug:Log(Object)
Target:GetLoggedInUserCallback(Message`1) (at Assets/Scripts/Target.cs:76)
Oculus.Platform.RequestCallback`1:HandleMessage(Message) (at Assets/OculusPlatform/Scripts/Callback.cs:131)
Oculus.Platform.Callback:HandleMessage(Message) (at Assets/OculusPlatform/Scripts/Callback.cs:148)
Oculus.Platform.Callback:RunCallbacks() (at Assets/OculusPlatform/Scripts/Callback.cs:55)
Oculus.Platform.Request:RunCallbacks(UInt32) (at Assets/OculusPlatform/Scripts/Request.cs:35)
Oculus.Platform.CallbackRunner:Update() (at Assets/OculusPlatform/Scripts/CallbackRunner.cs:28) - rfunk82ExplorerI fixed it by adding Oculus.Platform.Request.RunCallbacks()
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 months ago
- 9 years ago