> 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/conversation-targeting.md).

# 对话目标选择

查找用于选择目标模式、调优模式，以及在 Convai Unity SDK 房间中编写脚本指定玩家正在对哪个角色说话的指南。

会话定向是 Convai Unity SDK 在房间中有多个角色时，用来判断玩家正在与哪个角色交谈的方式。 `ConvaiManager` 它会持续重新评估这一判断，并将对话切换到玩家正在对话的角色，而无需添加组件或填写字段。

<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="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/how-conversation-targeting-works.md">对话目标选择如何运作</a></td></tr><tr><td><strong>选择一种目标模式</strong><br>根据你的摄像机和控制方案，在 Look At、Proximity 和 Manual 之间进行选择。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/choose-a-targeting-mode.md">选择目标模式</a></td></tr><tr><td><strong>调整对话目标选择</strong><br>调整范围、观察角度、切换余量和切换延迟，以适配你的场景。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/tune-targeting.md">调整对话目标选择</a></td></tr><tr><td><strong>为对话目标编写脚本</strong><br>通过代码移动对话，使用 <code>TalkTo</code>，并设置房间打开时所对应的角色，使用 <code>SetInitialCharacter</code>.</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/script-the-conversation-target.md">编写对话目标脚本</a></td></tr><tr><td><strong>编写自定义定向规则</strong><br>通过实现完全替换内置模式 <code>IConversationTargetProvider</code>.</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/custom-targeting-rule.md">编写自定义目标选择规则</a></td></tr><tr><td><strong>会话定向参考</strong><br>查找……的所有公共成员 <code>ConversationTargetingOptions</code> 及其默认值。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/targeting-reference.md">对话目标选择参考</a></td></tr><tr><td><strong>排查对话定位问题</strong><br>修复不会切换、闪烁不定，或根本从不移动的目标。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/troubleshooting.md">对话目标选择故障排查</a></td></tr></tbody></table>

### 定向如何融入场景

只有当场景注册了不止一个时，定向才有需要决定的内容 `ConvaiCharacter` 与 `ConvaiManager` ——只有一个角色的房间没有可供选择的对象。该设置位于 **Convai Manager → 玩家在和谁说话** 在检查器中的……下，而且该部分只有在出现第二个角色后才会显示。参见 [多角色会话如何工作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/multi-character-sessions/how-multi-character-sessions-work.md) 了解在定向开始起作用之前，房间如何组装其角色名单。

### 下一步

从 [对话定位的工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/how-conversation-targeting-works.md) 先了解该模型，然后 [选择一种目标模式](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/choose-a-targeting-mode.md) 选择适合你的摄像机和控制方式的模式。

{% content-ref url="/pages/f76eaea2a343c7d72b93487d582ec00dd7ba1c58" %}
[多角色会话](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/multi-character-sessions.md)
{% endcontent-ref %}


---

# 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/conversation-targeting.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.
