Load Avatars
Load 3D and 2D avatars into your Unity Scene.
Last updated
Was this helpful?
Load 3D and 2D avatars into your Unity Scene.
Last updated
Was this helpful?
In this guide, you learn how to load avatars into your Unity Scenes.
You can load full-body and half-body avatars into your Unity game. For both types of avatars you can follow the same procedure.
Create an instance of the AvatarObjectLoader
.
Call the LoadAvatar()
method with an avatar URL. The example uses a URL from the demo Avatar Creator . You will later learn how to retrieve an Avatar URL directly in your game.
3. Receive the GameObject of the avatar in CompletionEventArgs
of the OnCompleted
callback.
See the code below for the completed example.
See the API Reference for a complete list of callbacks of the AvatarLoader
.
Create an instance of AvatarRenderLoader
.
Call the LoadRender()
method, passing the required arguments.
The easiest way to save avatars in your project and package them with your build is using the Avatar Loader.
The Avatar Loader lets you download and save an avatar in your project in the Unity Editor.
Paste your avatar URL (or shortcode) into the Avatar URL or Shortcode field.
Optionally, check Use Eye Animations. This will add a component to the avatar GameObject.
Optionally, check Voice To Animation. This will add a component to the avatar GameObject.
Click Load Avatar into the Current Scene.
Your avatar loads into the current Scene at position (0,0,0).
You can load a 2D render of your avatar using the class which obtains a rendered image of your avatar via the Render API.
See the code below for a complete example.
See the to learn more about AvatarRenderLoader
and the function arguments.
Launch the Avatar Loader window by choosing Ready Player Me > Avatar Loader.
The avatar prefab is stored in a new folder (name = avatar ID) in Assets > Avatars
.