Serialization issue

DirtyHippy

New member
Hi -

On a tree today in 1.6.3 I had a prefab with a behaviour tree in it serialized in a scene referencing a simple external behavior.

I added a variable to the external tree, and then referenced that variable in the external behaviour tree via a compare boolean task. I did this without loading the scene with the prefab before hitting play. When the behaviour tree was executed the editor hung for a good amount of time and then threw an exception in serialization. I then stopped playing, loaded the scene in the editor with the prefab, and the scene hung on load again and threw the exception. I tried marking the scene dirty and saving it, hoping this would resolve the issue. It does not. After the initial hang if I click on the scene instance of that prefab it will throw the same exception again (and again).

Oddly an instance of this prefab was in another scene and it didn't exhibit this issue. I was able to resolve it by deleting the instance in the scene and then re-adding it. Everything works fine after that.

2018.4.13. This seems to have resolved, but I'm noting this just for your info.

ArgumentNullException: Value cannot be null.
System.RuntimeType.GetField (System.String name, System.Reflection.BindingFlags bindingAttr) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
BinaryDeserialization.LoadNodeData (BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.Dictionary`2[TKey,TValue] fieldIndexMap, BehaviorDesigner.Runtime.Tasks.Task task) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BinaryDeserialization.LoadTask (BehaviorDesigner.Runtime.TaskSerializationData taskSerializationData, BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.List`1[BehaviorDesigner.Runtime.Tasks.Task]& taskList, BehaviorDesigner.Runtime.BehaviorSource& behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.LoadBehavior (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, System.Boolean inspectorLoad) (at <16f31d5e691e49bb8277da3cfa8e17e2>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.UpdateTree (System.Boolean firstLoad) (at <16f31d5e691e49bb8277da3cfa8e17e2>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnSelectionChange () (at <16f31d5e691e49bb8277da3cfa8e17e2>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.OnSelectionChange () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:199)
 

Justin

Administrator
Staff member
Thanks for the heads up. If it happens again and can send me the broken tree I'd love to take a closer look at the cause.
 
Top