Can Playcanvas handle multiple NPC in one scene?

Hello,
I have one Convai avatar working great in PlayCanvas.
Can Convai & Playcanvas handle multiple NPC in one scene?
The NPCs are not conversing with each other, they are in separate areas.
My concern is that when I press L to talk, how does Convai know which Avatar I am talking to? Do the Avatars have proximity or a fall-off?

When adding an additional a character and duplicating the convaiNpc script with the new character ID, I got one error (Uncaught SyntaxError: Identifier ‘timeoutId’ has already been declared) which I fixed by using timeoutId2 for the second NPC.

However when I run. Only the second NPC talks, and he is re-positioned back at 0,0,0 on top of the first NPC. They both animate at the same time.

My guess is that the PlayCanvas Convai scripts have not been updated to allow multiple NPCs?

Its not readily available using convai web sdk as of now but you initialise convaiClient based on proximity and or have a currentActiveClient which changes based on proximity ( if both are initialised in the beginning). Will work on this.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.