Forum Discussion
Anonymous
7 years agoHow to use An Avatar in Oculus GO ?
I am making a game in Unity. Is there any blog or something which can help me understand how to use an avatar in Oculus go? I saw a video on youtube but Unity is showing an error of libovravatar.
GigaSora
7 years agoExpert Protege
I'd check this bad boy out: https://developer.oculus.com/documentation/avatarsdk/latest/concepts/avatars-sdk-intro/
Steps:
- Download the Oculus Integration package
- You need to first perform an entitlement check, so create a script for that. (Oculus integration comes with one, this lets you use the platform sdk in general)
- Add OvrCameraRig prefab to your scene. Then under tracking space object, add the LocalAvatar prefab (both in Oculus Integration)
- Then create a script for actually loading the avatar, it will set needed values on the ovravatar script. Here's mine.
Should load up the avatar.
Steps:
- Download the Oculus Integration package
- You need to first perform an entitlement check, so create a script for that. (Oculus integration comes with one, this lets you use the platform sdk in general)
- Add OvrCameraRig prefab to your scene. Then under tracking space object, add the LocalAvatar prefab (both in Oculus Integration)
- Then create a script for actually loading the avatar, it will set needed values on the ovravatar script. Here's mine.
public class LoadAvatar : MonoBehaviour
{
public OvrAvatar myAvatar;
void Awake()
{
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(); //string
myAvatar.oculusUserIDInternal = message.Data.ID; //ulong
Users.Get(message.Data.ID).OnComplete(GetUserInfo);
Debug.Log("Oculus ID is: " + message.Data.ID);
}
}
void GetUserInfo(Message<User> user)
{
Debug.Log("Oculus username is: " + user.Data.OculusID);
Destroy(this.gameObject);
}
}
Should load up the avatar.
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
- 7 months ago
- 2 months ago
- 9 months ago