> For the complete documentation index, see [llms.txt](https://jorge-jgnz94.gitbook.io/hptk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jorge-jgnz94.gitbook.io/hptk/master/modules/avatar.md).

# Avatar

![](/files/-MZgB4RN-jkh6BVvj8vy)

## Model

An avatar is an **entity with one or many body structures**. An avatar can have **extra modules** registered. Variables of this model are described bellow:

#### Body structure

* **Bodies:** List of possible different armatures (not representations) that represent a same user.
* **Body:** First item of the list of bodies. Handy for avatars with one body (most common case).

#### State

* **Ready:** `AvatarController.ControllerStart()` has been called and completed.

#### Extensibility

* **Registry:** List of controllers (HPTKControllers) of registered extra modules.

## View

#### Events

* **OnStarted:** Invoked after starting/validating each sub-model and after calling `ControllerStart()` of each of the `HPTKController`previously self-registered in AvatarModel or any of its sub-models.

{% hint style="info" %}
Some modules can be registered on the fly, after OnStarted is called. Using OnStarted to ensure that modules are ready is valid for modules that are self-registered before`AvatarController.ControllerStart()` is called.
{% endhint %}

## Controller

#### Buttons

* **Awake This:** Call `HPTKController.ControllerStart()`
* **Awake Children Models:** Call `HPTKModel.Awake()` for this model and any other HPTKModel under this. HPTKModels will try to fix missing references in their `Awake()` function.
* **Awake Children Views:** Call `HPTKView.Awake()` for this view and any other HPTKView under this.
* **Awake Children Controllers:** Call `HPTKController.Awake()` for this controller and any other HPTKController under this. HPTKController of modules will perform self-registry in their `Awake()` function.
* **Start This And Registered:** Call `HPTKController.ControllerStart()` which internally will call `ControllerStart()` for any of the controllers registered in AvatarModel or any of its sub-models, recursively.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://jorge-jgnz94.gitbook.io/hptk/master/modules/avatar.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.
