StateMachine and Global Scene Blackboards

NodeCanvas Forums Support StateMachine and Global Scene Blackboards

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16399
    grimjim
    Participant

    Hey,

    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.

    owner.blackboard = GlobalBlackboard.Find("Global");

    owner is a FSMOwner.

     

    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?

     

    Thank you in advance.

    #16405
    Gavalakis
    Keymaster

    Hello there,

    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 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #16406
    grimjim
    Participant

    Thank you very much.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.