cancel
Showing results for 
Search instead for 
Did you mean: 

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

ROBYER1
Level 4

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?

1 ACCEPTED SOLUTION

Accepted Solutions

ROBYER1
Level 4
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

View solution in original post

1 REPLY 1

ROBYER1
Level 4
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