How can I make the NPC look at me without location or button conditions?

Currently, Convai Metahuman blueprint works with the following logic:
To make the metahuman look at me (HMD location):

  1. Start the game.

  2. Approach the particular metahuman. I should be within their volume.

  3. I should look directly at the particular metahuman (not at some random area on the map).

  4. I should press a button to start talking.

  5. Right after I press the button, the NPC will immediately start looking at me.

What I want:

  1. Start the game.

  2. The NPC should look at me (HMD location) without any conditions regarding my location or the buttons I press.

Hello @Elon,

Welcome to the Convai Developer Forum!

To achieve the behavior you want, please refer to this documentation:

Actions Guide - Main Character and Attention Object

Additionally, make sure to set the LookExactlyAtCamera variable to true in both the BodyAnim and FaceAnim blueprints.

This should allow the NPC to look directly at your Player.
Let us know if you need further assistance! :blush:

I tried to launch Update Main Character from On Component activated Mesh, but then I realized, It won’t work, because I need to update the function ConvaiGetLookedAtCharacter to be able to Set Chatbot variable. Because variable Chatbot can be set only if special parameters like Radius, Player controller are set correct. However I can’t even read the function ConvaiGetLookedAtCharacter because it’s the part of Convai plugin

Please make sure to follow the documentation I’ve shared. It contains the necessary steps to address your issue.

You already shared many times that article. However it’s irrelevant for my case. That article is about “how to use set the Main character the AI is talking to and the Object In Attention”, which isn’t my goal. My goal is to set the Attention object BEFORE TALKING. NPC should focus on me regardless talking.

Check my screenshot, please. There you can see I’m trying to set Chatbot variable, but I can’t because I need to input some proper parameters for it.

I shared the documentation because it contains the solution to your request. If you place the logic in the Begin Play event, the NPC will turn its head toward you before any conversation starts. We expect our users to have a basic understanding of Unreal Engine, but for clarity, I’m sharing an example blueprint screenshot to illustrate this setup.

Additionally, if the NPC has its back to you and you want the body to turn as well, you can implement a small trick. In the Convai_MetaHuman_BodyAnim Animation Blueprint, navigate to the SetTurn Graph. Modify the Branch logic for IsInConversation by connecting the False Execution pin to the next node. This ensures the NPC always turns toward the player.

Here’s the relevant screenshot for reference. Let us know if you have any further questions! :blush:

1 Like

Now it’s clear. Thank you for this instruction.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.