Your next feature
Player Profile
Display the player's avatar, frame and badges.
Unity

Your visible result
The selected avatar, frame or badge appears in the profile after loading it again.
This step does not have a video yet. The guide and MCP request are ready to use.
Use player profiles
Build this feature
You can preview the guide. Running it requires an active project key. Prepare project
SDK installed, project configuration imported and player signed in.
This SDK example uses develop. Check whether the required APIs exist in your installed SDK.
C#
1using UnityEngine;
2using PM.horizOn.Cloud.Core;
3using PM.horizOn.Cloud.Manager;
4
5// Attach this script to a GameObject in your first scene.
6public class PlayerProfileDemo : MonoBehaviour
7{
8 async void Start()
9 {
10 // Setup: initialize, connect and sign in a player.
11 HorizonApp.Initialize();
12 await new HorizonServer().Connect();
13 await UserManager.Instance.SignUpAnonymous("PlayerName");
14
15 // horizOn: read the profile, then change avatar, frame and badges.
16 // Profile, unlocks and the cosmetics catalog of the signed in player
17 var profile = await PlayerProfileManager.Instance.GetProfile();
18 if (profile == null) { Debug.Log(PlayerProfileManager.Instance.LastErrorCode); return; }
19
20 // Save avatar, frame and up to three badges (ids from your catalog in the dashboard)
21 var updated = await PlayerProfileManager.Instance.SetProfile(
22 "avatar.zombie_07", profile.profile.frameId, new[] { "badge.supporter" });
23 }
24}
Test your new feature.
The selected avatar, frame or badge appears in the profile after loading it again.
Choose the same project in the dashboard as in your game configuration.


