Load Avatars
Load 3D and 2D avatars into your Unity Scene.
Load 3D Avatars
var avatarUrl = "https://api.readyplayer.me/v1/avatars/632d65e99b4c6a4352a9b8db.glb";
AvatarObjectLoader avatarLoader = new AvatarObjectLoader();
avatarLoader.LoadAvatar(AvatarURL); using ReadyPlayerMe.AvatarLoader;
using ReadyPlayerMe.Core;
using UnityEngine;
namespace ReadyPlayerMe
{
public class AvatarLoadingExample : MonoBehaviour
{
//Demo Avatar URL
[SerializeField]
private string avatarUrl = "https://api.readyplayer.me/v1/avatars/632d65e99b4c6a4352a9b8db.glb";
private GameObject avatar;
private void Start()
{
ApplicationData.Log();
var avatarLoader = new AvatarObjectLoader();
avatarLoader.OnCompleted += (_, args) =>
{
avatar = args.Avatar;
AvatarAnimatorHelper.SetupAnimator(args.Metadata.BodyType, avatar);
};
avatarLoader.LoadAvatar(avatarUrl);
}
private void OnDestroy()
{
if (avatar != null) Destroy(avatar);
}
}
}
Load 2D Avatars
Save avatars as NPCs in your project
Last updated
Was this helpful?



