# Loading 2D Avatars

This example demonstrates how to request an avatar render image via the Render API and apply the result to a UI sprite. This approach may be useful for showing a profile picture of an avatar in a heads-up display or use it as a button icon.

{% hint style="info" %}
This example has been tested in Unity 2020.3LTS and newer versions.
{% endhint %}

{% hint style="info" %}
**Scene and Code**

`Assets/Samples/Enoch Avatar Loader/1.0.0/AvatarRender/AvatarRenderExample`
{% endhint %}

1. Open and play the **AvatarRender/AvatarRenderExample** Scene.
2. Open the **AvatarRenderExample.cs script**.
   * Notice that a 2D render uses the same avatar URL as the 3D render of the same avatar.
   * Creates an instance of `AvatarRenderLoader`.&#x20;
   * Defines the `OnCompleted()` callback for the `AvatarRenderLoader`; this is called when loading has successfully completed and creates a sprite for the avatar.
   * Calls `LoadRender()` with the URL for the avatar to load, the type of scene to render, the name of the target blend shape mesh, and the blend shapes.&#x20;

{% hint style="info" %}
See the [**AvatarRenderLoader API**](https://enoch-app.gitbook.io/enoch/developers-integration-guide/unity-integration/code-examples/broken-reference) documentation for details on `LoadRender()` arguments.
{% endhint %}
