# AvatarObjectLoader

The AvatarLoader class is used for loading and downloading avatar models and configuring the output.Enochavatar**AvatarLoader** loads the avatar from the provided `url` and stores it in local storage. Used by Enochavatar**ActorComponent**.

### Public Functions <a href="#public-functions" id="public-functions"></a>

| Function                                                                                                                                                                                                                                                                       | Returns | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `LoadAvatar( const FString& UrlShortcode, class U`Enochavatar`PlayerMeAvatarConfig* AvatarConfig,`USkeleton\* TargetSkeleton, const FglTFRuntimeSkeletalMeshConfig& SkeletalMeshConfig, `const FAvatarLoadCompleted& OnLoadCompleted, const FAvatarLoadFailed& OnLoadFailed);` | void    | Downloads the avatar asset from the `UrlShortcode`and saves it in local storage.                                                          |
| `CancelAvatarLoad();`                                                                                                                                                                                                                                                          | void    | Immediately cancels avatar loading. When the garbage collector is removing the AvatarLoader, avatar loading gets automatically cancelled. |

#### LoadAvatar() Parameters <a href="#loadavatar-parameters" id="loadavatar-parameters"></a>

| Parameter                                                | Description                                                                                                                                                                                        |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| const FString& UrlShortcode                              | Avatar url or shortcode.                                                                                                                                                                           |
| UEnochavatarPlayerMeAvatarConfig\* AvatarConfig          | Config for loading avatar with custom configuration.                                                                                                                                               |
| USkeleton\* TargetSkeleton                               | Chose the skeleton that will be used for the loaded avatar. If not set, the default skeleton will be used.                                                                                         |
| const FglTFRuntimeSkeletalMeshConfig& SkeletalMeshConfig | glTFRuntime skeletal mesh config that will be used for loading the avatar.Important: This property should be changed only for very special cases as changing this property might break the avatar. |
| const FAvatarLoadCompleted& OnLoadCompleted              | Success callback. Called when the avatar asset is downloaded.                                                                                                                                      |
| const FAvatarLoadFailed& OnLoadFailed                    | Failure callback. If the avatar fails to load, the failure callback will be called.                                                                                                                |


---

# 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/api-references/unreal-engine-sdk/avatarobjectloader.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.
