image

How to get started with the Ready Player Me Unity Avatar SDK

Written by Ready Player Me

  • 09 March 2021
  • 4 min read
How to get started with the Ready Player Me Unity Avatar SDK

How to add a 3D avatar creator into your Unity-based app or game

Ready Player Me is more than an avatar creator – it's a platform that any developer can add to their apps and games. All it takes for the user to create their personal avatar is to take a selfie and customize it to their liking. Ready Player Me is already compatible with VRChat, LIV, Mozilla Hubs, 50 more official partners, and many smaller developers using our avatar SDK.

Implementing Ready Player Me is simple. It took one to two days for most of our partners to integrate our avatar creator into their products.

In this guide, we are going to focus on our Unity package. We will guide you through our avatars' import process, both inside the editor and at runtime.

Requirements

For the Ready Player Me Unity package to work properly, you'll need:

  • Unity 2018LTS and newer versions of the Unity3D game engine
  • A valid avatar URL created from Ready Player Me to import an avatar into a Unity scene

For iOS builds, the Microphone Usage Description field in Player Settings must be filled with an appropriate message. VoiceHandler component requires microphone permission. If this area is not filled, the build will fail. To build without microphone permission, remove this script.

Dependencies

Dependencies are already included in the Ready Player Me .unitypackage file. If you are using an older or a newer version of these dependencies, please backup your project before making changes.

  • GLTFUtility - 0.6
  • Newtonsoft JSON - 12.0.1.22727

Getting started with the Ready Player Me Unity Avatar SDK

If you worked with Unity before, then the Unity package's import process should be easy for you. Here's how it goes:

  1. Download the latest version of the Ready Player Me Unity package from our releases page
  2. Open the Unity project you want to use
  3. Import the package from the top Unity Editor toolbar via Assets > Import Package > Custom Package
  4. Select the Ready Player Me Unity package from file explorer and import it. A window will pop up, hit "OK" to start importing the package into your project.

You can also import a Unity package by dragging and dropping it into the Project tab in the Unity window.

How to use the Ready Player Me Unity Avatar SDK

To launch the Ready Player Me Unity Avatar SDK editor window within Unity, select ReadyPlayerMe in the Avatar Loader menu.

To create and save your avatar in editor time, paste your avatar URL from the Ready Player Me website and click on the "Load Avatar" button.

To load an avatar during playtime, create an instance of AvatarLoader and call LoadAvatar the method from the instance with the URL of the avatar to load.

private void LoadAvatar()
{
    AvatarLoader avatarLoader = new AvatarLoader();
    avatarLoader.LoadAvatar(avatarUrl, AvatarLoadedCallback);
}

private void AvatarLoadedCallback(GameObject avatar)
{
    Debug.Log("Avatar Loaded!");
}   

This operation will download and load the avatar model to the scene. You can get access to the avatar game object in the scene via a callback method.

API documentation for Ready Player Me Unity Avatars

Here are classes that you can call within Ready Player Me Avatar SDK. As we said before, it's fairly simple!

  • AvatarLoader – the main class used for loading and downloading avatar models and configures the output
  • public void LoadAvatar(string url, Action<GameObject> callback = null) – initiates avatar download and import operations
  • public int Timeout – the timeout value for avatar download request
  • public bool UseModelCaching – used for caching downloaded models by their GUID. If enabled, models will be loaded from users local instead of being downloaded again

Important – making a new avatar will not give you a new GUID. It will update your avatar on the same URL instead. Use caching if you are sure that you will not update your avatar. Otherwise, the old avatar will be loaded.

Loading Mixamo Animations for the Ready Player Me Unity avatars

Full-body Ready Player Me avatars are compatible with Adobe's Mixamo animations. Here's what you have to do to use the animations with our avatars:

  1. Go to Mixamo's website and sign up or log in
  2. Upload either FemaleAnimationTarget or MaleAnimationTarget from Assets/Plugins/Wolf3D ReadyPlayerMe SDK/Resources/AnimationTargets to Mixamo.

    You can find this folder by clicking on the Reveal Animation Targets Folder button on the editor window.

3. After Mixamo completes processing the animation target, pick an animation that you want to use. Then click "Download."

4. When the download settings dialogue shows up, select FBX for Unity format and skin as Without Skin. Finally, click "Download."

5. Move the downloaded animation into your Unity project by drag it into a female or male Animator Controller.


That's all you have to know to get started with Ready Player Me Unity Avatar SDK. For more, including our Unreal SDK, check our developer documentation. Feel free to join our Discord server and chat with our team on the #developer-discussion channel.

If you would like to use Ready Player Me for a commercial product, reach out to our team.

Become a Ready Player Me Partner

Are you making a commercial project with Ready Player Me avatars? Fill the form and become a Ready Player Me Partner to get a free license.

How to get started with the Ready Player Me Unity Avatar SDK

For Developers

One-Stop-Shop For Your Avatar Needs

We spent seven years building the perfect avatar system, so you don't have to. Integrate Ready Player Me into your app or game in less than a day. For free.
Do you have a question about integration? Contact us