When user presses the button on screen, a particular text string (hi) must be sent to the avatar and the avatar responds to the ‘hi’ how it normally does. To put it shortly, I don’t want to use the Text to Type or the Voice functionality but instead make the user interact through buttons presses.
I saw a previous thread where it said to use the ConvaiNPC’s SendTextDataAsync function but it was pretty confusing. Apart from Unity, is there any way to do this with React and 3js?
You need to call SendTextDataAsync from your button’s OnClick event and pass the text string (e.g. "hi") there, instead of using the normal text input or microphone.
If you are not very familiar with Unity UI and events, I recommend using a coding assistant (like ChatGPT) and asking it to generate a small C# example that calls ConvaiNPC.SendTextDataAsync("hi") from a Button OnClick.
For React + Three.js, the idea is the same: trigger the Convai text interaction method from your button’s onClick handler. The exact implementation will depend on how you are calling the Convai API/Web SDK in your project, so you’ll need to wire it according to your frontend stack.