Error: Client already finished sending

Reply by dhvl5 | 2024-07-26 08:55:10

I think I upgraded the SDK successfully and also modified the template but still getting the above error object ConvaiGRPCWebAPI not found! <@1023671043287699568>

Reply by k3kalinix | 2024-07-26 08:55:21

Hello <@423303543156375553>

Reply by k3kalinix | 2024-07-26 08:55:36

This means that you have changed the name of the ConvaiGRCWebAPI gameobject.

Reply by dhvl5 | 2024-07-26 08:56:13

Oh actually I’ve put that script on my camera, and that gameobject name is Main Camera

Reply by k3kalinix | 2024-07-26 08:56:29

Rename it to ConvaiGRPCWebAPI

Reply by dhvl5 | 2024-07-26 08:57:08

Oh let me try

Reply by dhvl5 | 2024-07-26 09:02:51

Oh dear god it works now. Thank you so much <@1023671043287699568>

Aside from that why is that a hard requirement tho? Could’ve just made it as a singleton, this doesn’t seem like a good practice as an SDK because the dev won’t be able to know this and he/she can integrate the SDK however they want without worrying about the gameobject name.

Reply by k3kalinix | 2024-07-26 09:04:10

Okay, In WebGL, the communication between JS and Unity is done with SendMessage.

The name of the object must be exactly the same.

The object name is ConvaiGRPCWebAPI in Javascript and MainCamera in your object. Therefore, communication cannot be established.

Documentation: Unity - Manual: Call Unity C# script functions from JavaScript

Embedded Content:
Link: Unity - Manual: Call Unity C# script functions from JavaScript

Reply by dhvl5 | 2024-07-26 09:05:10

I need one more help from you. Is there any way to disable the UIs? I do not want ChatHandler or anything. I tried disabling the UI object itself but it isn’t working.

Replying to k3kalinix’s Message

Reply by k3kalinix | 2024-07-26 09:04:10
Okay, In WebGL, the communication between JS and Unity is done with SendMessage.

The name of the object must be exactly the same.

The object name is ConvaiGRPCWebAPI in Javascript and MainCamera in your object. Therefore, communication cannot be established.

Documentation: Unity - Manual: Call Unity C# script functions from JavaScript

Reply by dhvl5 | 2024-07-26 09:05:30

Understood.

Replying to dhvl5’s Message

Reply by dhvl5 | 2024-07-26 09:05:10
I need one more help from you. Is there any way to disable the UIs? I do not want ChatHandler or anything. I tried disabling the UI object itself but it isn’t working.

Reply by k3kalinix | 2024-07-26 09:05:47

Set canvasgroup alpha to 0

Reply by dhvl5 | 2024-07-26 09:06:44

There are many canvases and by default it is at 0.

Reply by k3kalinix | 2024-07-26 09:07:07

review the code

Reply by dhvl5 | 2024-07-26 09:07:28

Images:

Reply by k3kalinix | 2024-07-26 09:07:30

When we change the active NPC you will see that it is 1.

Reply by k3kalinix | 2024-07-26 09:07:42

This is settings panel.

Reply by dhvl5 | 2024-07-26 09:08:51

Okay.

Reply by dhvl5 | 2024-07-26 09:09:08

Thank you :pray:

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