Reply To: Blackboard – Object References & Serialized Variables

NodeCanvas Forums Support Blackboard – Object References & Serialized Variables Reply To: Blackboard – Object References & Serialized Variables

#14737
Gavalakis
Keymaster

Hello again,

To be honest, I have no experience with AMS at all, so thank you for the information 🙂

Setting the references (either _objectReferences, or _references in SerializationPair) directly would not work correctly because those references go on pair with the actual serialization json string. So, even if you set the references via reflection, the reference will be cleared as soon as the variable is serialized again, since by setting the reference there only, it does not also set the variable value.

So, your original way of doing it (using bb.SetVariableValue) is actually the most correct way as well. That is because doing this, will actually set the Variable value and then as a result of that, when the Blackboard is being serialized, it will store the reference to the _references list.

I hope this makes sense, but please let me know if not. 🙂

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