This document explains how to make characters respond to events happening in their surroundings with a small example.
Our goal in this example is to have the character welcome the player whenever the player enters a certain area, this can be done by using the Invoke Speech
node that basically invokes the AI character to talk and a simple collision box.
Open your AI character blueprint and select the Viewport
tab.
Note: the character blueprint can be a MetaHuman, ReadyPlayerMe, Reallusion or even a custom one you have created, just ensure that it has the Convai Chatbot
component.
From the Components
list add a Box Collision
.
Switch back to the Event Graph
tab.
Select the Box Collision
you just added and scroll down in the Details panel
. Under Events
add the On Component Begin Overlap
event to your event graph.
Setup the following blueprint schematic which uses the Invoke Speech
node from the Convai Chatbot
component.
Enter a Trigger Message
that expresses what happened (i.e. "Player Approached") and you can add a simple instruction (i.e. Greet the player).
Setting the In Generate Actions
and In Voice Response
boolean to true will let the Convai Characters perform actions and generate audio responses respectively.
Hit Compile
and Save
then run the program.
On approaching a certain vicinity will trigger the event and the Convai Character will greet the character as mentioned in the Trigger Message.
The above example is just a simple use case. However, the use of Invoke Speech opens new doors to limitless use cases.