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

# 对话目标选择故障排查

修复在 Convai 多角色房间中无法切换、在角色之间闪烁或始终不移动的对话目标。

诊断为什么在多人角色房间里，对话目标没有选择你期望的角色。下面的每一项都涵盖了你在 Play 模式下可以观察到的一种症状。

### 开始之前

* 选择 `ConvaiManager` 在 Play 模式下的 Inspector 中并打开 Live 部分。它会显示当前被对话的角色、玩家是否可以与其交谈，以及上一次目标选择决定背后的判定。
* 打开 **Convai → Troubleshooter** 用于生成一份一次性报告，涵盖目标选择以及其余对话状态。如果你使用编码助手， `Convai.DiagnoseConversation` 工具会报告相同内容，包括目标选择规则及其值，以及它们是否仍为出厂默认值。
* 确认场景中有两个或更多 `ConvaiCharacter` 组件已注册——单角色房间不会运行目标选择逻辑。

### 看向某个角色并不会将对话切换到该角色

**症状：** 玩家的视角明显对着某个角色，但对话仍停留在另一个角色身上，或者没有任何角色。

**原因：** 该角色的距离或角度超出了 `MaxDistance` 或 `MaxAngle`，因此它没有资格被对话。

**解决方法：**

1. 打开 `ConvaiManager` → **玩家与谁对话** 并检查 **范围（米）** 和 **视线角度（度）**.
2. 把排除该角色的那个值调大。参见 [调整对话目标选择](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/tune-targeting.md).

**验证：** 一旦玩家的视角进入范围和角度内，Live 部分就会报告该角色已被对话。

### 对话在两个角色之间闪烁切换

**症状：** 在玩家的视角或位置没有明显变化的情况下，被对话的角色不断在两个候选者之间来回切换。

**原因：** `SwitchMargin` 或 `SwitchDelaySeconds` 对于角色站得这么近的情况来说太低了，因此很小的镜头移动就足以触发切换。

**解决方法：**

1. 先提高 `SwitchMargin` ——它在 `LookAt`.
2. 下以度为单位测量。 `SwitchDelaySeconds` 如果闪烁仍然持续，也提高

**验证：** 。

### Live 部分中被对话的角色会在玩家的视角大致停留在某个候选者身上时保持稳定。

**症状：** 完全没有切换

**原因：** `ConversationTargeting.Mode` 设置为 `Manual`，因此除了调用 `TalkTo`.

**解决方法：** 确认 **选择方式** 中的字段 **玩家与谁对话**。如果 `Manual` 是有意为之，就用 `TalkTo` 来驱动目标——参见 [为对话目标编写脚本](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/script-the-conversation-target.md)。如果这不是有意的，请切换到 `LookAt` 或 `Proximity`.

**验证：** 当玩家看向或靠近另一个角色时，Live 部分中的被对话角色会发生变化。

### `TalkTo` 似乎没有任何作用

**症状：** 调用 `manager.TalkTo(character)` 不会推动对话发生变化，而且 Console 会记录 `[ConvaiManager] Cannot talk to '<name>': it is not in the current room. Only characters that joined this connection can be addressed.`

**原因：** 传入到 `TalkTo` 的角色不属于当前房间——它要么从未注册过，要么自从房间连接后就离开了房间。

**解决方法：** 确认该角色是 `ConvaiCharacter` 组件之一，并且已加入当前连接。 `manager.ConversationTarget` 以及房间名单可确认当前成员资格。

**验证：** 警告不再出现，Live 部分会将请求的角色报告为已被对话。

### 对话似乎卡在保持某个角色不变

**症状：** 即使玩家显然已经不再看着该角色，或者离它不近了，被对话的角色也不会改变。

**原因：** 这可能是正确行为，而不是故障。目标不会自行清空——当当前没有任何对象符合资格时，最后一个被对话的角色会维持对话，而不是让对话变成静默。

**解决方法：** 检查 `ConvaiManager.ConversationTargetingStatus` （或 Live 部分的判定）来区分“被保持的目标”和“卡住的目标”—— `AlreadyActive` 或 `HeldForDelay` 表示目标选择正在按设计工作。如果即使玩家明显在指向新的人物时判定也从不变化，请检查该角色在当前 `MaxDistance` 和 `MaxAngle`.

**验证：** 中是否符合资格。将一个真正符合资格的角色移入范围和角度后，被对话的角色会发生变化。

### 相关页面

{% content-ref url="/pages/bf13178545671bf5315d6096bbd1d925cf1b57a5" %}
[对话目标选择如何运作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-targeting/how-conversation-targeting-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/2c6d63cffd7b1ec0697bd7dd2aa8bd901ef1f717" %}
[排查多角色会话问题](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/multi-character-sessions/troubleshooting.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/troubleshooting.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.
