Load Avatars

Load 3D and 2D avatars into your Unreal Engine project.
In this guide, you learn how to load avatars into your Unreal Engine project.

Load 3D avatars

The Ready Player Me Unreal Engine plugin comes with one pre-made Blueprint BP_RPM_Actor. You can add this Blueprint to any map and use it for loading a Ready Player Me avatar from a URL at runtime.

Ready Player Me Actor Blueprint

Find ReadyPlayerMe Content/Blueprints/BP_RPM_Actor and examine it in the Components panel. The components are described below.

Skeletal Mesh Component

  1. 1.
    Select the SkeletalMeshComponent. The SkeletalMeshComponent is required and holds all the skeletal mesh data once the avatar has been loaded.
  2. 2.
    Examine its Details and under the Animation heading, find the AnimClass property. Its default value is BP_RPM_Animation. You need to set this to the Animation Blueprint you want to use for the character.
The Anim Class property must be set in the editor before you build or run the application, otherwise, the animation will not play on the avatar for built applications.

Ready Player Me Component

The ReadyPlayerMeComponent is an ActorComponent that you can add to any existing actor. It requires a SkeletalMeshComponent. If you try to load an avatar on an actor without a SkeletalMeshComponent, it will add a new one automatically.
  1. 1.
    Select the ReadyPlayerMe Component. The ReadyPlayerMeComponent has all the functionality required for loading a Ready Player Me avatar with a single function call.
  2. 2.
    Examine its details under the Ready Player Me heading. Find the Url Shortcode and Target Skeleton properties.
  • Url Shortcode contains the Ready Player Me Avatar URL or Shortcode of an avatar created with the Avatar Creator.
  • Target Skeleton defines the skeleton that the loaded character will use with skinning and animation.
If you want to create or use your own target skeleton, it must perfectly match the skeleton that you are loading from the URL. We do not recommend that you change this property.
  1. 1.
    Examine the Event Graph.
  2. 2.
    Find the Load Avatar On Start Boolean variable. Set this variable to enable or disable the avatar loading process from running on EventBeginPlay as shown below in the Event Graph.

Loading the avatar

You can use two different methods for loading an avatar with the Ready Player Me Actor Blueprint (BP_RPM_Actor) or any Actor that has a ReadyPlayerMeComponent: LoadAvatar or LoadNewAvatar
  • LoadAvatar only requires a reference to the ReadyPlayerMe Component you wish to run it on. This function assumes that you have already set the Url Shortcode to use for loading the avatar model.
  • LoadNewAvatar has an additional Url parameter so that you can update the ReadyPlayerMeComponent's Url Shortcode variable before loading the avatar.
Both of these functions have OnSetupFailed()functions for basic error handling.

Load 2D avatars

You can load a 2D render of your avatar using the ReadyPlayerMeRenderLoader class which obtains a rendered image of your avatar via the Render API.
The URL of the avatar needs to be provided for rendering the avatar.
void Load(const FString& ModelUrl, const ERenderSceneType& SceneType, const TMap<EAvatarMorphTarget, float>& BlendShapes, const FDownloadImageCompleted& OnCompleted, const FDownloadImageFailed& OnFailed)