# 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**](broken://pages/BflcEp4S6glE8bnltEvk) documentation for details on `LoadRender()` arguments.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enoch-app.gitbook.io/enoch/developers-integration-guide/unity-integration/code-examples/loading-2d-avatars.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
