Keyword events from character speech

Hello Convai-Folks !!

Is it possible to execute a function when an NPC says a specific keyword in PlayCanvas?
Is there a textRecieved type parameter that holds the text from the server?

Thanks,

From another perspective. How can I capture the users input as text in PlayCanvas?
I’d like to pass the final text input to a function for checking.

Any thoughts on either of these points would be most welcome.

The user input should be in the code itself.

Also you do get the transcript (microphone). You can check the convai-chat code.

@Saurav Thanks a lot for the reply.
I took a look at ConvaiChat.js and took this.currentUserText from the HandleChat function.
It seems to be safe enough.

2 Likes