Skip to main content
Inspiring
November 14, 2022
Solved

How to detect if a user doesn't have a Meta Avatar or if they have been assigned a default avatar?

I am working with the Meta Avatars SDK and can't find any way to detect if a user doesn't already have a Meta Avatar, and as part of this I can't find a way to detect if the user has simply been assigned a default avatar.

I have the ability to let the user open the customise avatar menu via a deeplink call, but no way to detect if I should tell the user to create an avatar first time if they don't have one?

This topic has been closed for replies.
ROBYER1Answer
Inspiring
November 16, 2022
Found it in OVRAvatarEntity.cs
 
/// True if the avatar has any avatar loaded other than the default avatar.
       public bool HasNonDefaultAvatar { get; private set; }
 
Also I tried a suggestion of using the mirror ie.from the Oculus Avatar samples > mirror scene which gives me this error for a user who has no avatar, which is of no good as it actually causes issues in the build!
 
[ovrAvatar2 sampleAvatar] Unable to find user avatar with userId 4961820950580892. Falling back to local avatar.
 
Checking hasNonDefaultAvatar from above worked though I had to check that value like 10-15 realtime seconds after avatar loading as it flagged wrong until the user's actual avatar has fully loaded as the loading callbacks fired early

1 reply

ROBYER1AuthorAnswer
Inspiring
November 16, 2022
Found it in OVRAvatarEntity.cs
 
/// True if the avatar has any avatar loaded other than the default avatar.
       public bool HasNonDefaultAvatar { get; private set; }
 
Also I tried a suggestion of using the mirror ie.from the Oculus Avatar samples > mirror scene which gives me this error for a user who has no avatar, which is of no good as it actually causes issues in the build!
 
[ovrAvatar2 sampleAvatar] Unable to find user avatar with userId 4961820950580892. Falling back to local avatar.
 
Checking hasNonDefaultAvatar from above worked though I had to check that value like 10-15 realtime seconds after avatar loading as it flagged wrong until the user's actual avatar has fully loaded as the loading callbacks fired early