Integrate Player Zero avatars and analytics into your Unity game with just a few lines of code. This SDK lets you load and customize avatars, transfer meshes onto existing characters, and track in-game events seamlessly.
π Full Docs: Unity Integration Documentation β
β οΈ Note: Unity builds with Player Zero require stripping level set to 'Low'. 'Medium' and 'High' are not supported yet.
Prefer watching? Here's a short video walkthrough to get started in under 5 minutes. Want to dive deeper? Check out this video on analytics integration.
- You've connected with a Player Zero team member.
- Your developer account is set up, and credentials are provided.
- If using a custom rig, your base FBX should have been shared and registered.
- Visit the Unity SDK GitHub Releases page.
- Download the latest
.unitypackageor add it via the Unity Package Manager.
- Go to
Tools β Player Zeroin Unity. - Use the credentials provided by your account manager to log in.
var avatar = await PlayerZeroSdk.InstantiateAvatarAsync(new CharacterRequestConfig {
AvatarId = "AVATAR_ID_HERE"
});var avatar = await PlayerZeroSdk.InstantiateAvatarAsync(new CharacterRequestConfig {
AvatarId = "AVATAR_ID_HERE",
BlueprintId = "BLUEPRINT_ID_HERE"
});var avatarId = PlayerZeroSdk.GetHotLoadedAvatarId();
var avatar = await PlayerZeroSdk.InstantiateAvatarAsync(new CharacterRequestConfig {
AvatarId = avatarId,
BlueprintId = "BLUEPRINT_ID_HERE"
});// Assume `inputField` is a Unity UI InputField containing the code
var code = inputField.text;
var avatarId = await PlayerZeroSdk.GetAvatarIdFromCodeAsync(code);
var avatar = await PlayerZeroSdk.InstantiateAvatarAsync(new CharacterRequestConfig {
AvatarId = avatarId,
BlueprintId = "BLUEPRINT_ID_HERE"
});Use PlayerZeroSdk.GetIconAsync to request a 2D render of an avatar:
AvatarRenderConfig config = ScriptableObject.CreateInstance<AvatarRenderConfig>();
var sprite = await PlayerZeroSdk.GetIconAsync("AVATAR_ID_HERE", options);
image.sprite = sprite;Seamlessly apply a Player Zero avatar's visuals to an existing prefab:
var avatar = await PlayerZeroSdk.InstantiateAvatarAsync(new CharacterRequestConfig {
AvatarId = "AVATAR_ID_HERE",
BlueprintId = "BLUEPRINT_ID_HERE"
});
new MeshTransfer().Transfer(avatar, existingCharacter);- Add the
PlayerZeroAnalyticscomponent to an empty GameObject in your first scene. - Set your Game ID in
Tools β Player Zero.
PlayerZeroSdk.StartEventSession<GameSessionStartedEvent, GameSessionStartedProperties>(
new GameSessionStartedEvent {
Properties = new GameSessionStartedProperties {
AvatarId = PlayerZeroSdk.GetHotLoadedAvatarId()
}
}
);Want to link into specific avatars or features? Check out the docs on Deeplinking.