Forum Discussion
feiyangwang980616
5 years agoHonored Guest
I try to get the user ID to set the oculus avatar. However the ID I get is always 0.
How to get the correct user ID
void Awake()
{
Debug.Log("---------------------------------");
text.text = "begin";
Oculus.Platform.Core.Initialize();
Oculus.Platform.Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);
Oculus.Platform.Request.RunCallbacks(); //avoids race condition with OvrAvatar.cs Start().
}
private void GetLoggedInUserCallback(Message<User> message) {
if (!message.IsError) {
myAvatar.oculusUserID = message.Data.ID.ToString();
text.text = "no error id is: "+ myAvatar.oculusUserID;
Debug.Log("ID:");
Debug.Log("message.Data.ID.ToString()");
}
3 Replies
- AnonymousI was struggling with the same thing just now. Apparently, you now have to enable access to the user ID in the developer dashboard, which is not reflected anywhere in the avatar documentation.
https://forums.oculusvr.com/developer/discussion/95734/unity-getloggedinuser-always-returning-message-data-id-0 - feiyangwang980616Honored Guest
krzys_h said:
I was struggling with the same thing just now. Apparently, you now have to enable access to the user ID in the developer dashboard, which is not reflected anywhere in the avatar documentation.
https://forums.oculusvr.com/developer/discussion/95734/unity-getloggedinuser-always-returning-message-data-id-0
I got the access but the ID I get is still 0. Do you know what should I do next? - VRJohnnyExplorer
I have a similar issue. I am getting the correct oculusUserID but when I set it and then enable the object containing my LocalAvatar, I still get the default white avatar. Any ideas?
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
- 8 months ago
- 3 months ago
- 1 month ago
- 9 months ago