# Component

Actor component for Enoch avatar avatars.Enochavatar**PlayerMeComponent** is an Actor component responsible for loading the avatar and visualizing it by setting its SkeletalMesh. It also provides functions for loading the avatar and loading a rendered image of the avatar. **EnochavatarComponent** internally uses **EnochAvatarAvatarLoader** for loading the avatar and **EnochAvatarRenderLoader** for rendering the avatar.The Actor containing this component must also contain a SkeletalMeshComponent.

### Properties <a href="#properties" id="properties"></a>

| Property              | Type                           | Description                                                                                                                                                                                                                                                                                |
| --------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| UrlShortcode          | FString                        | The avatar URL or shortcode used to load the avatar from the web.                                                                                                                                                                                                                          |
| TargetSkeleton        | USkeleton\*                    | Chose the skeleton that will be used for the loaded avatar. If not set, the default skeleton will be used.                                                                                                                                                                                 |
| AvatarMetadata        | FAvatarMetadata                | Provides read-only information about the loaded avatar, such as the type, outfit, or gender.                                                                                                                                                                                               |
| AvatarConfig          | UEnochavatarAvatarConfig\*     | Avatar configuration asset data. Used to load the avatar with the specific configs.If no config is set, the partner-specific configs will be used for loading the avatar.                                                                                                                  |
| SkeletalMeshComponent | USkeletalMeshComponent\*       | Skeletal mesh component used for setting the skeletal mesh of the loaded avatar. If not set, it will be initialised with the skeletal mesh component of the parent Actor.For runtime animation retargeting, if the Actor has multiple skeletal mesh components, this property must be set. |
| SkeletalMeshConfig    | FglTFRuntimeSkeletalMeshConfig | 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.                                                                                         |

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

| Function                                                                                                                                    | Returns | Text                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LoadAvatar( const FAvatarLoadCompleted& OnLoadCompleted, const FAvatarLoadFailed& OnLoadFailed);`                                          | void    | Downloads the avatar from the web and generates a skeletal mesh of it. If the model was previously downloaded and stored locally, the local model will be used if avatar caching is enabled. |
| `LoadNewAvatar( const FString& Url, const FAvatarLoadCompleted& OnLoadCompleted, const FAvatarLoadFailed& OnLoadFailed);`                   | void    | ​                                                                                                                                                                                            |
| `LoadRender(const ERenderSceneType& SceneType, const FDownloadImageCompleted& OnCompleted, const FDage for townloadImageFailed& OnFailed);` | void    | Loads the rendered image of the avatar from the server. By setting the `SceneType` the avatar can be rendered in different scenes.                                                           |
| `CancelAvatarLoad();`                                                                                                                       | void    | Immediately cancels avatar loading. When the garbage collector is removing the component, avatar loading gets automatically cancelled.                                                       |

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

| Parameter                                   | Description                                                                                |
| ------------------------------------------- | ------------------------------------------------------------------------------------------ |
| const FAvatarLoadCompleted& OnLoadCompleted | Success callback. Called when the avatar asset is downloaded and the skeletal mesh is set. |
| const FAvatarLoadFailed& OnLoadFailed       | Failure callback. If the avatar fails to load, the failure callback will be called.        |
| const FString& Url                          | Avatar URL or shortcode.                                                                   |

​


---

# 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/component.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.
