We started using NodeCanvas StateMachine and we want to have a state that won’t destroy when loading another scene, so far that works.
The problem we have is that in each scene we have different objects that we want to have a reference to, just activating and deactivating gameobjects. For that we use the GlobalBlackboard we deactivated don’t destroy so each scene has its own and all the references in the scene.
Now when we change the scene the StateMachine cant reference them anymore so it seems after a scene load it’s not aware of the GlobalBlackboard.
A workaround that works so far is when a new scene is loaded and active we set the global blackboard.
So the questions for us are:
– Is the workaround valid or will we face issues later down the line as we probably overwrite the bound Blackboard? It works for us as we don’t have any variables in the bound blackboard so far.
– Is there a better approach to having a state machine that won’t be destroyed while playing and that also can have references to different objects in all scenes even ones that will be loaded later on?
Setting/overriding the owner gameobject Blackboard (that is not the same as the graph blackboard), is totally fine and there is even an inspector field to assign a Blackboard other than the one that is on the gameobject. This solution is just fine for what you are after 🙂