My Convai NPC is not being destroyed when i unload the scene that it is in

Original Discord Post by newbietechbro | 2024-08-19 18:01:13

I have a base scene that loads an additive scene. The additive scene is the convai AR scene with my NPC character. When I unload the additive scene, I unload the Convai AR additive scene and load another non-Convai additive scene. The issue is that my Convai NPC does not disappear from the screen. I can’t seem to find anything that keeps the Convai NPC persistent even after the unload. What should I do?

Reply by k3kalinix | 2024-08-19 18:02:10

Hello <@796390213164859422>,

Reply by k3kalinix | 2024-08-19 18:03:31

Could you please type the following in the Hierarchy Search Box

“t:ConvaiNPC”

Reply by newbietechbro | 2024-08-19 18:03:57

yep

Reply by newbietechbro | 2024-08-19 18:03:59

did that

Reply by k3kalinix | 2024-08-19 18:04:23

And could you please share Hierarchy’s screenshot?

Reply by newbietechbro | 2024-08-19 18:04:40

Images:

Reply by k3kalinix | 2024-08-19 18:06:10

Did you load the Non Convai scene?

Reply by newbietechbro | 2024-08-19 18:06:39

yes, the other additive non-convai scene is able to be loaded, but the additive convai scene doesn’t go away

Reply by k3kalinix | 2024-08-19 18:07:44

How do you unload?

Reply by newbietechbro | 2024-08-19 18:12:19

I unload from the base scene:
here, it shows that if the currentAdditiveScene is the convai scene (CharacterTour), then it unloads

Images:

Reply by k3kalinix | 2024-08-19 18:14:18

Do you see any logs about this in the console?

Reply by newbietechbro | 2024-08-19 18:15:27

yes it says that it starts the unloading

Reply by newbietechbro | 2024-08-19 18:17:15

The additive Convai scene is based off the demo scene, is there something in the convai scripts that keeps the character on the screen? Because the chatbox dissappears when I unload the Convai additive scene, just no the character

Reply by k3kalinix | 2024-08-19 18:23:26

Can I see the Hierarchy when you unload the scene?

Reply by newbietechbro | 2024-08-19 18:29:54

Is that done in the editor? The issues is, for the Convai additive scene to unload, I would need to scan another tracked image, but I don’t know how to do that from the editor

Reply by k3kalinix | 2024-08-19 18:32:26

You can call this code by pressing a key.

Reply by k3kalinix | 2024-08-19 18:32:39

Create an Update method and call it.

Reply by newbietechbro | 2024-08-19 18:39:55

But how would I make it detect a different tracked image?

Reply by newbietechbro | 2024-08-19 18:40:57

I can press a key to call OnTrackedImageschanged, but I don’t understand how I can make it so that I can alter the trackedImage.referenceImage.name

Images: