Multi scene workflow question

I have scenes for UI and the current scene where the player is, so when I switch scenes I unload the current one and additively add the next one.

The problem is that Astar shows the error saying I can’t have more than 2 Pathfinder components. So then I deleted the component immediately when switching the scene, and a bunch of null reference exceptions came, because all the agents are still searching for paths. So now I made it wait until the scene was fully unloaded to load the new one, so there are no 2 pathfinder components at the same time, but it shows a warning saying there are no mesh filters found. Also I kind of don’t like the fact that I have to wait for it to be unloaded.

I searched on the forum and have been troubling myself with this for a long time so I hope someone can help me.

Thanks!

Hi

Could you elaborate?
From what I can tell, you should only need one A* component in the same scene that the agent is in.

Yes, the problem is that, when switching the scenes additively, it seems I have to be very precise because Astar will complain if there’s even one frame of two scenes having pathfinder at the same time, and also complain if I delete the pathfinder on the scene that is to be unloaded earlier than I should because the agents need it. So basically I have errors whatever I do

Hi

Hmm. You could either make sure to first delete the A* component, or you could keep only a single A* object at all times and change graphs using: Saving and Loading Graphs - A* Pathfinding Project