Error Copying Behavior Tree

Zaddo

Active member
Edit: I saw in one of the other posts, Jason's suggestion to change to save as JSON. This fixed my issue. I am leaving this here in case it helps someone else.

I am getting a crash when trying to create a new Behavior tree based on the FirstPersonShooter Scene.

I exported the Behavior tree from the demo scene. Initially I tried to copy the entire tree into the new tree, but this failed with errors and trees dissapearing. So now I am trying to copy one branch at a time. I consistently get the below error and the copied sections disappear from the new tree.

My Exported tree also stops working. And I cant open it after a while. Restarting Unity does not recover the issue with the exported tree. The file is there, but I continue to get the below errors.

My Environment:
I am using version 2020.1.3f1 Personal. With Version 1.6.5 of Behavior Designer and Version 2.2.5 of Ultimate Character Controller, together with the Behavior Designer Movement Pack. Patched version of Windows 10.

All the demos were downloaded from the Opsive website in the last 24 hours.

If anyone has had same issue and found a fix, please let me know what that is.

Thx.

Error generated on tree after copy.

C#:
InvalidCastException: Specified cast is not valid.
BinaryDeserialization.BytesToSharedVariable (BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.Dictionary`2[TKey,TValue] fieldIndexMap, System.Byte[] bytes, System.Int32 dataPosition, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Boolean fromField, System.Int32 hashPrefix) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BehaviorDesigner.Editor.GraphDesigner.Load (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, UnityEngine.Vector2 nodePosition) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.LoadBehavior (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, System.Boolean inspectorLoad) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.LoadBehavior (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.BehaviorSelectionCallback (System.Object obj) (at <4b28e19850d5443cb0dab9a889df4542>:0)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <701f6580abad44cfb237a543dcd0d94b>:0)


Errors when opening exported tree

Error1:

C#:
InvalidCastException: Specified cast is not valid.
BinaryDeserialization.BytesToSharedVariable (BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.Dictionary`2[TKey,TValue] fieldIndexMap, System.Byte[] bytes, System.Int32 dataPosition, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Boolean fromField, System.Int32 hashPrefix) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <ddb5579d0d23478c9f73ec2f99600079>:0)
BehaviorDesigner.Editor.GraphDesigner.Load (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, UnityEngine.Vector2 nodePosition) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.LoadBehavior (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, System.Boolean inspectorLoad) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.UpdateTree (System.Boolean firstLoad) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnGUI () (at <4b28e19850d5443cb0dab9a889df4542>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEditor.DockArea.OldOnGUI () (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&


Error 2:

C#:
ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <2500dd078a544a69b6c923861af6cd15>:0)
UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at <2500dd078a544a69b6c923861af6cd15>:0)
UnityEngine.GUILayout.BeginArea (UnityEngine.Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at <2500dd078a544a69b6c923861af6cd15>:0)
UnityEngine.GUILayout.BeginArea (UnityEngine.Rect screenRect, UnityEngine.GUIStyle style) (at <2500dd078a544a69b6c923861af6cd15>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.DrawFileToolbar () (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.Draw () (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnGUI () (at <4b28e19850d5443cb0dab9a889df4542>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEditor.DockArea.OldOnGUI () (at <701f6580abad44cfb237a543dcd0d94b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2500dd078a544a69b6c923861af6cd15>:0)
 
Last edited:
Top