Add Unity Events while processing response

Original Discord Post by josegarciacordoba | 2024-07-13 07:53:23

Since the avatar response can take a few seconds in some cases, I’d like to know how I can add custom Unity events to trigger certain actions while the response is being processed.

I’ve looked at the NPC Script but the help doesn’t work, it’s a URL that doesn’t exist:

https://docs.convai.com/api-docs/plugins-and-integrations/unity-plugin/overview-of-the-convainpc.cs-script

Thanks.

Reply by k3kalinix | 2024-07-15 21:44:27

Hey <@992368851234869308> :wave:t2:

Reply by k3kalinix | 2024-07-15 21:45:44

There is no event about this at the moment. But I have informed the Unity team and they will make changes in future updates.

Reply by k3kalinix | 2024-07-15 21:47:40

Basically we will need 2 events.

  1. When you send a request,
  2. When the first response arrives.

You can make edits in ConvaiGRPCAPI or ConvaiNPC script.

If you want, we can check together on this issue at a convenient time.

Replying to k3kalinix’s Message

Reply by k3kalinix | 2024-07-15 21:44:27
Hey <@992368851234869308> :wave:t2:

Reply by josegarciacordoba | 2024-07-18 17:01:48

Ok, I’ve already made changes to the convaiNPC and it works. Just one event that is triggered when the microphone activation button is released and another that is triggered when the Avatar starts the response. So I already have that time limited.

Thanks

This conversation happened on the Convai Discord Server, so this post will be closed.