> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unreal-engine/guides/actions-guide/main-character-and-attention-object.md).

# 主角色和关注对象

1. 导航到你的 AI 角色蓝图。
2. 将 `Convai 聊天机器人` 将组件添加到事件图中。
3. 获取 `环境` 对象，并确保它有效。
   1. 使用函数 `设置主角色` 来将当前说话者定义为 AI 角色。此外，如果你使用的是 Convai 的动画蓝图，那么设置主角色将使 AI 角色看向主角色引用。
   2. 使用函数 `设置关注对象` 来设置当前正在谈论的是哪个对象，此函数还会自动将输入对象添加到环境中已存在对象的列表中。

{% hint style="info" %}
角色蓝图可以是 MetaHuman、ReadyPlayerMe、Reallusion，甚至是你创建的自定义蓝图，只需确保它具有 `Convai 聊天机器人` 组件。
{% endhint %}

<figure><img src="/files/ed47de06bb34ca58d36aa4e9c6b543254e09824b" alt=""><figcaption><p>Set Main Character 和 Set Attention Object 函数的示意图</p></figcaption></figure>


---

# 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://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unreal-engine/guides/actions-guide/main-character-and-attention-object.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.
