Avatar Creator (WebGL)

Integrate the Avatar Creator with you Unity WebGL project.

This sample project uses a custom WebGL template to embed the Ready Player Me character creator inside an application to seamlessly add avatars. Use this as a reference for adding Ready Player Me avatars to your Unity WebGL application.

This example has been tested in Unity 2020.3LTS and newer versions. See Troubleshooting if you encounter build errors.

Import the samples

Open the Unity Package Manager and find the Ready Player Me Core Package.

You can find the code samples on the package manager's right side. Find the WebGLSample and click Import.

WebGL Sample Setup

When you first import the sample you should see a popup that offers to automatically import the custom WebGLTemplate and a WebGL helper library. We recommend clicking okay to simplify the setup process.

If you click Ok you and if it imports successfully you should notice that it added the following folders:

  • Assets/WebGLTemplates/RPMTemplate

  • Assets/Plugins/WebGlHelper

If for some reason the above folders do not exist you can manually import the RpmWebGLTemplate.unitypackage yourself. It is located in the project tab under Packages/Ready Player Me Core/Editor/WebView

Running the project

  1. Make sure you are building for WebGL and WegGLExample is included in the Build Settings.

  2. Open Project Settings > Player > Settings for WebGL > Resolution and Presentation and select the RPMTemplate

  3. Build and run the project. You should see a Create Avatar button

  4. When you click Create Avatar Button it will launch the Avatar Creator

  5. From here you can create an avatar, close the Avatar Creator

  6. Once you finalize the avatar by clicking next you should see the Avatar Creator window close and the avatar will be loaded into the scene

Using the WebGL Template

If you have followed the installation steps correctly you should be able to select the RPMTemplate from the Project Settings window under Player/WebGL/Resolution and Presentation.

Last updated