SceneManager.UnloadSceneAsync stops BehaviorDesigner

gcmountaing

New member
I'm having trouble with BehaviorDesigner stopping when SceneManager.UnloadSceneAsync is executed.

On my system, when a new Scene is loaded, the old Scene is unloaded with SceneManager.UnloadSceneAsync(oldScene).
When the UnloadSceneAsync completes, the new Scene's BehaviorDesigner seems to stop.
Is there a workaround to prevent the BehaviorDesigner from stopping?

For example, if I Disable a GameObject whose BehaviorDesigner has stopped, and then Enable it
Then the BehaviorDesigner will restart. However, I don't want to perform this kind of restart.

Please tell me how to work around this so that GameObjects that implement BehaviorDesigner are not affected by UnloadSceneAsync.

UnloadSceneAsync absolutely needs to be called.
 

Attachments

  • 無題.png
    無題.png
    52.5 KB · Views: 0
The behavior tree component requires the Behavior Manager so make sure that stays in the scene. You can use DontDestroyOnLoad to ensure it persists across scenes.
 
Top