> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
