question

Terrell Stephen avatar image
Terrell Stephen asked

How to handle preset avatars without URL?

My project has a list of avatars that a player can choose from that is contained in an object. The selected avatar is referenced by a simple int and stored in the PlayFab's player data. This is working fine for the player, but is this the best way to handle something like this?

If so, my other question is how to properly reference this with friends. Using GetFriendList API call doesn't seem to allow me to access player data, and I don't think getting all the profiles individually is the correct way to go about this.

What's the solution here?

Friends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

According to your description, I assume you want the player can choose the avatar from the list of avatars you set in the Title Object and can access the avatar URL with the int number, if so, the way you choose to handle the preset avatars without URL is a proper way.

In this case, you can call UpdateAvatarUrl API to store the avatar int number in the Player Avatar URL, then you can call GetFriendsList API and set ShowAvatarUrl property in the ProfileConstraints to true, then you can get the avatar int number of your friends. Please note that you need to nagitive to Title Settings-> Client Profile Options page to check the Avatar URL option so that you can get the avatar number successfully.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.