Blackboard variables can indeed be stored/restored by serializing and then deserializing the Blackboard to json string with the existing methods Blackboard.Serialize() and Blackboard.Deserialize(string json). You can then probably use this json string returned by Serialize as a part of your save game, pretty much similar to how zsoik suggests. As zsoik stated too, UnityEngine.Object variable references will not persist through Serialize/Deserialize though, since such Object references can’t really be serialized to json in any usable way.
Regarding the current active node, if you are referring to the FSM system, then you could save the name of the current state which can be retrieved through the ‘FSMOwner.currentStateName’ property and then use ‘FSMOwner.TriggerState(string name)’ to basically force enter the previously saved state node when loading. You will of course need to have explicit state names for this to work correctly.
zsoik’s suggestion is also quite nice as well 🙂
Let me know if either of this works for you, or if I can help in any further way.
Thanks
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.