Null reference caused by serialization.

oatmealaddict

New member
Hi,

attached is a picture of a compare between two serializations of the same behavior tree.

Bildschirmfoto 2020-07-12 um 17.01.45.png

The left behavior tree causes a null reference exception when referenced as external behavior tree task, the right one works just fine.

I downloaded the source code and the null reference exception happens at line 600 in BehaviorManager.cs (I don't want to post non public code here) which seems to be responsible for the "linking" of shared variables between the parent tree and the external behavior tree, so it my two cents is that the exception is caused by "Variables" only containing null on the left.

The difference between the two behaviors is that the left one was created, used a custom shared variable type, whose definition I then changed to another class. The right behavior was created from scratch.

My current workaround is to just deleted lines 29 to 32 in the left tree.

TL;DR: Changing shared variable names or definitions cause errors in the serialization.
 
Top