Original Discord Post by therealfoofie | 2024-07-13 17:23:20
In our Unity 2D project, we have imported a custom character from Convai. The character works perfectly until the prefab is disabled and the triggers are used to have a conversation with our 2D NPC. The raycast on the Player Camera detects the chat trigger but it seems that either the audio is not being sent or the NPC can’t be heard.
This is the error we get when we press T to talk.
Can anyone support us in this error, please?
Hello K3, I’m working together with TheRealFoofie.
If the question is about Convai’'s version, it is Convai_Unity_WebGL_SDK_Nightly_31.01.2024
It’s important to say that the demo scene is working perfectly on our build.
We are trying to leave the “Convai Game Character” game object and the npc in scene (just like on the demo scene) while deactivating their meshes.
We position them in a way that on the start of the scene we get the debug message “Player is near Convai NPC” (there is only one active npc in the scene), which I assume should enable the pressing of T and the start of the dialogue with the npc.
On our Build, we sometimes get the error message when T was pressed and released too early - convais’s default one, I’m pasting an image of the game running on Unity so you can see which message it is. On the Build, sometimes we get this default error message, sometimes the browser error message that my partner posted above and the game crashes.
Convai’s main camera, child to the player character, was disabled and our camera was placed in the same position in hierarchy while moving the Convai GRPC WEb API and Convai NPC Manager scripts to this camera.
Hello <@446507502268317697>,
I can see that you have some Null errors.
Probably you have missed some components.
Also please review this screenshot. You are probably spamming the talk key.
Thanks for the fast answer
would it be possible to have a short call? It would be much faster to explain.
The null error is from another script of ours, it doesn’t affect the build. I removed that script, the error is gone when running on unity, the build presents the same behaviour.
Yes, we were spamming the T button, so we could test on our build this system.
On our build and while running on unity, we don’t get the “Not close enough to the character” error (we do have the “Player is near Convai NPC” debug message, I suppose it is enough?)
We do see some functionalities working on the editor, like the blue circle around the camera/convai game character triggering when it is close enough to the npc.
We are not expecting to use the voice chat on unity’s editor.
The thing is, in our game you don’t need to get close to the npc to talk to it, it should be always possible to hit a button and talk, no matter where the main character is.