How to check distancein Convai in unity

Currently, if my character is far, I’m not able to talk. I want to be able to talk to it from anywhere.

Hello @Prabhu,

There are a couple of ways you can handle this:

  1. Easiest Option:
    In your scene, go to the Convai Essentials Prefab. Under the ConvaiNPCManager component (located on Convai Player Character / Camera), try increasing the Ray Length and Angle values. This extends the range and angle for detecting NPCs. However, this might not always be reliable depending on your scene setup.

  1. Advanced Option:
    If you’re comfortable modifying code, you can edit the ConvaiNPCManager.cs script.

    • Disable the NPC detection logic inside the LateUpdate() method.
    • Then, in the Start() method or another appropriate place, call UpdateActiveNPC() and manually set the NPC you want to keep active.

    Do note that this method will make only one NPC active at a time. If you have multiple NPCs, you’ll need to manage which one is active yourself.

This distance adding ray length is better. I have one more issue if i am using your character everything is fine. If i use my character it is not working. It is saying that it is far. If i add your character from fresh also same issue

Show me the inspector of your character.