> 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/convai-unity-sdk/features/character-actions.md).

# 角色动作

角色动作使 NPC 角色能够通过场景中的物理行为响应玩家请求——导航、对象交互、动画以及自定义游戏逻辑。 `ConvaiActionDispatcher` 可以在批次中的第一个动作开始执行前进行阻止，直到角色开始说话；当该动作通过以下方式选择加入时： `WaitForBotSpeech`。对动作、对象、角色和注意力的运行时更新，只有在 Convai 确认后才会生效。本节涵盖从第一个可用配置到完整脚本 API 的所有内容。

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>角色动作的工作原理</strong><br>了解流程、关键概念、必需组件和内置执行器。</td><td><a href="/pages/53aa8db086c9806f093f80741862dfe3316e77d8">/pages/53aa8db086c9806f093f80741862dfe3316e77d8</a></td></tr><tr><td><strong>角色动作快速上手</strong><br>为你的 NPC 添加一个可用的“移动到”动作——无需编写脚本。</td><td><a href="/pages/7f0d213ddc809cfd39ab2bc41492ddf8e54b6c19">/pages/7f0d213ddc809cfd39ab2bc41492ddf8e54b6c19</a></td></tr><tr><td><strong>配置角色动作</strong><br>完整参考文档，适用于 <code>ConvaiActionConfigSource</code> ——动作定义、目标以及连接时覆盖项。</td><td><a href="/pages/111bca064ba7041a987662d038af4d71d58a32cd">/pages/111bca064ba7041a987662d038af4d71d58a32cd</a></td></tr><tr><td><strong>在运行时更新角色动作</strong><br>应用 <code>ConvaiActionConfigPatch</code> 在会话处于活动状态时，对动作、对象、角色和注意力的更新，由后端 ACK 确认。</td><td><a href="/pages/4001c6ae3c6d4603942748007a37a67812bb7e9a">/pages/4001c6ae3c6d4603942748007a37a67812bb7e9a</a></td></tr><tr><td><strong>动作执行器</strong><br>包含所有七个执行器组件的参考，并附有 Inspector 字段表。</td><td><a href="/pages/f592d9dc3ad261e175159690b86cdd4b50bb4d81">/pages/f592d9dc3ad261e175159690b86cdd4b50bb4d81</a></td></tr><tr><td><strong>分发器和批次策略</strong><br>配置如何 <code>ConvaiActionDispatcher</code> 处理并发批次和步骤失败。</td><td><a href="/pages/6e3c85bad169c9c2c755b38be39008ef3ce023cf">/pages/6e3c85bad169c9c2c755b38be39008ef3ce023cf</a></td></tr><tr><td><strong>编写自定义动作执行器</strong><br>实现 <code>IConvaiActionExecutor</code> 为任何动作创建项目特定的行为。</td><td><a href="/pages/c5598abd0ddd72fa75a0989ad602a5b4d12e16d7">/pages/c5598abd0ddd72fa75a0989ad602a5b4d12e16d7</a></td></tr><tr><td><strong>注意力与引用锚定</strong><br>确保 Convai 的目标解析与玩家在运行时关注的内容保持一致。</td><td><a href="/pages/5b02ee57da9de48585f7ea92aa9e94714547d80a">/pages/5b02ee57da9de48585f7ea92aa9e94714547d80a</a></td></tr><tr><td><strong>角色动作脚本参考</strong><br>所有动作系统类型、事件、枚举和组件的完整公共 API。</td><td><a href="/pages/0341126fa4c492311dab4fb6aca6d0c64191016b">/pages/0341126fa4c492311dab4fb6aca6d0c64191016b</a></td></tr><tr><td><strong>角色动作示例</strong><br>从无代码 Inspector 配置到脚本化批次注入和与语音同步的时序，共五个逐步进阶的场景。</td><td><a href="/pages/0e9ccbf7f8fa10ad65f6395315d82ba64412791c">/pages/0e9ccbf7f8fa10ad65f6395315d82ba64412791c</a></td></tr><tr><td><strong>排查角色动作问题</strong><br>使用以下内容诊断动作流程问题 <code>ConvaiActionDebugProbe</code> 以及症状/原因/修复参考。</td><td><a href="/pages/1398e3302b345ef93934a0e6c93b4d8e576ab00e">/pages/1398e3302b345ef93934a0e6c93b4d8e576ab00e</a></td></tr></tbody></table>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
