Behavior Manager

ClosetGamer

New member
Hello, I am expericning a few issues with Behavior Manager.

A bit of background: I currently have a few levels of my game designed. I have each level stored in a separate scene. Each scene has a few behavior trees running controlling NPCs etc.

My current setup is: Behavior Manager stored as a child of my GameManager singleton, which is DontDestroyOnLoad. The first scene I load works fine, and the behavior trees run. Loading the next scene, however the Behavior Trees do not run - and I can see an additional Behavior Manager has been created in the loaded scene.

I have tried removing Behavior manager from my GM object. When I do this, the first scene loads and creates a behavior manager. When loading a different scene the same issue occurs.

A few observations:
  1. Disabling and renabling the gameobjects containing behavior trees get them working again
  2. Multiple behavior managers are created when going backwards and forwards between scenes. This always seems to occur in "Main" which is scene 0 in loadedScenes[] if that makes any difference - perhaps it is targetting the active scene.

What are the rules concerning the usage of Behavior Manager?
 
Last edited:
Top