NullReferenceExceptions when adding nodes

Rene Damm

New member
To try out BD Pro in our game, which uses ECS, I've added the Behavior Tree script to a GO in an entities subscene, clicked "Open", added a "Start" node and tried adding a "Sequence" node to it. Doing this I get

NullReferenceException: Object reference not set to an instance of an object
Opsive.GraphDesigner.Editor.GraphWindow.AddNodeProperties (System.Collections.Generic.List`1[Opsive.GraphDesigner.Runtime.LogicNodeProperties]& nodesData, Opsive.GraphDesigner.Runtime.ILogicNode node) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.GraphWindow.SerializeGraph (System.Boolean force) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Views.GraphView.AddNode (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 position) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Elements.Edge.OnFilterWindowSelection (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 windowPosition) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectObject (System.Object selectedObject, System.Type baseType) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectElement (Opsive.Shared.Editor.UIElements.FilterWindowProvider+Element selectedElement) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow+ListViewContainer+FilterElement.OnMouseDown (UnityEngine.UIElements.MouseDownEvent evt) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <9ac54da9a3624080ae596e505f7da9ed>:0)

This happens with every of the composite nodes (and, just tested, also with every other node from the spacebar menu).

If I go to one of the samples from the package and try to add a Sequence node (or any other node) as a child of an node in one of the existing graph, I get a different exception

IndexOutOfRangeException: Index was outside the bounds of the array.
Opsive.GraphDesigner.Editor.GraphWindow.AddNodeProperties (System.Collections.Generic.List`1[Opsive.GraphDesigner.Runtime.LogicNodeProperties]& nodesData, Opsive.GraphDesigner.Runtime.ILogicNode node) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.GraphWindow.SerializeGraph (System.Boolean force) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Views.GraphView.AddNode (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 position) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Elements.Edge.OnFilterWindowSelection (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 windowPosition) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectObject (System.Object selectedObject, System.Type baseType) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectElement (Opsive.Shared.Editor.UIElements.FilterWindowProvider+Element selectedElement) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow+ListViewContainer+FilterElement.OnMouseDown (UnityEngine.UIElements.MouseDownEvent evt) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <24e165613ea9441aa6d9c8989219aecd>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <9ac54da9a3624080ae596e505f7da9ed>:0)

Unity 6. BD Pro 2.0.1.
 
Last edited:
Adding a Subtree, to try that route, another NRE

NullReferenceException: Object reference not set to an instance of an object
Opsive.BehaviorDesigner.Runtime.BehaviorTree+BehaviorTreeBaker.GetStartTaskConnectedIndex (Opsive.BehaviorDesigner.Runtime.BehaviorTree behaviorTree) (at ./Packages/com.opsive.behaviordesigner/Runtime/BehaviorTree.cs:1640)
Opsive.BehaviorDesigner.Runtime.BehaviorTree+BehaviorTreeBaker.Bake (Opsive.BehaviorDesigner.Runtime.BehaviorTree behaviorTree) (at ./Packages/com.opsive.behaviordesigner/Runtime/BehaviorTree.cs:1608)
Unity.Entities.Baker`1[TAuthoringType].InvokeBake (Unity.Entities.IBaker+BakerExecutionState& state) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/Baker.cs:2253)
Unity.Entities.BakedEntityData.ApplyBakeInstructions (Unity.Entities.Baking.BakeDependencies& dependencies, Unity.Entities.Baking.IncrementalBakingContext+IncrementalBakeInstructions instructions, Unity.Entities.BlobAssetStore blobAssetStore, Unity.Entities.BakingSettings bakingSettings, Unity.Entities.Baking.GameObjectComponents& components) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:780)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/Stubs/Unity/Debug.cs:17)
Unity.Entities.BakedEntityData:ApplyBakeInstructions(BakeDependencies&, IncrementalBakeInstructions, BlobAssetStore, BakingSettings, GameObjectComponents&) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:784)
Unity.Entities.BakingSystem:Bake(IncrementalBakingChangeTracker, GameObject[]) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakingSystem.cs:155)
Unity.Entities.BakingUtility:BakeScene(World, Scene, BakingSettings, Boolean, IncrementalBakingChangeTracker) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakingUtility.cs:84)
Unity.Scenes.Editor.LiveConversionDiffGenerator:Bake(BakingFlags) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionDiffGenerator.cs:189)
Unity.Scenes.Editor.LiveConversionDiffGenerator:UpdateLiveConversion(Scene, Hash128, LiveConversionDiffGenerator&, LiveConversionMode, UInt64, GUID, IEntitiesPlayerSettings, LiveConversionChangeSet&) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionDiffGenerator.cs:431)
Unity.Scenes.Editor.LiveConversionConnection:AddLiveConversionChangeSet(LiveConversionDiffGenerator&, Hash128, List`1, UInt64, LiveConversionMode) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionConnection.cs:404)
Unity.Scenes.Editor.LiveConversionConnection:Update(List`1, NativeList`1, NativeList`1, LiveConversionMode) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionConnection.cs:369)
Unity.Scenes.Editor.EditorSubSceneLiveConversionSystem:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/EditorSubSceneLiveConversionSystem.cs:62)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:723)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:681)
Unity.Scenes.Editor.LiveConversionEditorSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionEditorSystemGroup.cs:15)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:723)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:681)
Unity.Entities.InitializationSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/DefaultWorld.cs:169)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ScriptBehaviourUpdateOrder.cs:523)
 
I just tried a similar set of steps but didn't get any errors. To be sure we are on the same page, can you open up the Entities sample scene and try adding a behavior tree to the Spawner GameObject and add some tasks to see if you get the same error?
 
Thanks for responding.

It does result in the same error. Seems the only node I can add is a start node. Anything else results in said NRE.
 
I have the same problem. I tried it with existing and new projects in urp and hdrp with versions 6000.0.34f1 and 6000.0.39f1 and I can't add any nodes except for branch events. I also get this error:

NullReferenceException: Object reference not set to an instance of an object
Opsive.GraphDesigner.Editor.GraphWindow.AddNodeProperties (System.Collections.Generic.List`1[Opsive.GraphDesigner.Runtime.LogicNodeProperties]& nodesData, Opsive.GraphDesigner.Runtime.ILogicNode node) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.GraphWindow.SerializeGraph (System.Boolean force) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Views.GraphView.AddNode (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 position) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Elements.Edge.OnFilterWindowSelection (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 windowPosition) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectObject (System.Object selectedObject, System.Type baseType) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectElement (Opsive.Shared.Editor.UIElements.FilterWindowProvider+Element selectedElement) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow+ListViewContainer+FilterElement.OnMouseDown (UnityEngine.UIElements.MouseDownEvent evt) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEvent_BubbleUpCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement element) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <5968ce65056b40d4a7a81f60d007014a>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <029a7e34967d4bcab4fb906072b81369>:0)
 
Hmm, I'm still having issues reproducing this one. Here's what I tried:

1. Created a new Unity 6 project
2. Imported Behavior Designer Pro
3. Imported the sample scenes
4. Selected the Entities sample scene, enabled the EntitySubScene
5. Selected the Spawner entity
6. Added the Behavior Tree component
7. Used the filter window to add a Sequence task. The Start node was automatically created and I didn't get any errors.

Are those steps similar to what both of your are doing?
 
I tried it this way but I get the same error. It is also not just in the EntitySubScene I can't add any node except for the branch events in any Behavior Tree no matter if it is on a new component or on an existing tree.

New Behavior Trees also have no Start node, I can add it but it is not added automatically.

I realized that I got an IndexOutOfRangeException once when I tried your example and after that I alway get a NullReferenceException when I try to add a node.
 
Hi, I am experiencing the same issues, only with the different setup.
Using Unity 6000.0.38f
Behavior Designer Pro 2.0.1

I have created a new project couple of days ago. It includes UCC, Puppet Master and Behavior Designer.
Initially I used the old Behavior Designer, but today I have purchased the pro version.
I have removed the old BD package and any extra integrations, then installed a fresh Behavior Designer Pro package with Movement Add-On.

How do I recreate an issue:
I add an new GameObject to the scene and the add BehaviorTree component to it.
I click open, on the BehaviorTree component.
I try to add "Repeat" task (any other task raises the same issue) and nothing happens in the editor window.

P.S. If I go to the Behavior Tree Editor via the Tools menu, no error get's logged into the console, but nodes aren't adding either.

My console log entry
NullReferenceException: Object reference not set to an instance of an object
Opsive.GraphDesigner.Editor.GraphWindow.AddNodeProperties (System.Collections.Generic.List`1[Opsive.GraphDesigner.Runtime.LogicNodeProperties]& nodesData, Opsive.GraphDesigner.Runtime.ILogicNode node) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.GraphWindow.SerializeGraph (System.Boolean force) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Views.GraphView.AddNode (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 position) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.GraphDesigner.Editor.Views.GraphView.OnFilterWindowSelection (System.Object selectedObject, System.Type baseType, UnityEngine.Vector2 windowPosition) (at <411f6cab61f547fc9934c1ecb61bf909>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectObject (System.Object selectedObject, System.Type baseType) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow.SelectElement (Opsive.Shared.Editor.UIElements.FilterWindowProvider+Element selectedElement) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
Opsive.Shared.Editor.UIElements.FilterWindow+ListViewContainer+FilterElement.OnMouseDown (UnityEngine.UIElements.MouseDownEvent evt) (at <d3e3c74dbd3d4cf58de31b5794b64d3e>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <f1c909cad80d4b24ac89c1095fc1f01b>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1b026406e9c7449283af5e3e7bcf93f9>:0)

Edit: Noticed that by default Unity used ESC 1.3.8, updated ECS to 1.3.10 - same results.
 
Last edited:
Thanks! I was finally able to reproduce it, I'll have a fix submitted shortly :) The download will then be available shortly after that. I'll let you know.
 
I've fixed this - the fix is being pushed as 2.0.1f2. It should be released within the next hour or two. I'll update this thread as soon as it has been released.

@Rene Damm - This will fix the error that you received, but subtrees will not work within the baked scenes since the subtrees are evaluated dynamically at runtime. I will add an log message for this case (it'll be in version 2.0.2).
 
This version is now live. Thanks for letting me know about the error. The joys of a new asset release 🤣
 
Thank you for the fix. Can now add nodes. However, still getting NREs.

NullReferenceException: Object reference not set to an instance of an object
Opsive.BehaviorDesigner.Samples.Attack.OnAwake () (at Assets/Samples/Opsive Behavior Designer/2.0.1/Sample/Scripts/Tasks/Attack.cs:32)
Opsive.BehaviorDesigner.Runtime.Tasks.Task.Initialize (Opsive.BehaviorDesigner.Runtime.BehaviorTree behaviorTree, System.UInt16 runtimeIndex) (at ./Packages/com.opsive.behaviordesigner/Runtime/Tasks/Task.cs:100)
Opsive.BehaviorDesigner.Runtime.Tasks.StackedTask.Initialize (Opsive.BehaviorDesigner.Runtime.BehaviorTree behaviorTree, System.UInt16 runtimeIndex) (at ./Packages/com.opsive.behaviordesigner/Runtime/Tasks/StackedTask.cs:184)
Opsive.BehaviorDesigner.Runtime.BehaviorTree.InitializeBranch (Unity.Entities.World world, Unity.Entities.Entity entity, Opsive.GraphDesigner.Runtime.IEventNode eventTask) (at ./Packages/com.opsive.behaviordesigner/Runtime/BehaviorTree.cs:590)
Opsive.BehaviorDesigner.Runtime.BehaviorTree.InitializeTree (Unity.Entities.World world, Unity.Entities.Entity entity) (at ./Packages/com.opsive.behaviordesigner/Runtime/BehaviorTree.cs:448)
Opsive.BehaviorDesigner.Runtime.BehaviorTree+BehaviorTreeBaker.Bake (Opsive.BehaviorDesigner.Runtime.BehaviorTree behaviorTree) (at ./Packages/com.opsive.behaviordesigner/Runtime/BehaviorTree.cs:1604)
Unity.Entities.Baker`1[TAuthoringType].InvokeBake (Unity.Entities.IBaker+BakerExecutionState& state) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/Baker.cs:2253)
Unity.Entities.BakedEntityData.ApplyBakeInstructions (Unity.Entities.Baking.BakeDependencies& dependencies, Unity.Entities.Baking.IncrementalBakingContext+IncrementalBakeInstructions instructions, Unity.Entities.BlobAssetStore blobAssetStore, Unity.Entities.BakingSettings bakingSettings, Unity.Entities.Baking.GameObjectComponents& components) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:834)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at ./Library/PackageCache/com.unity.entities/Unity.Entities/Stubs/Unity/Debug.cs:17)
Unity.Entities.BakedEntityData:ApplyBakeInstructions(BakeDependencies&, IncrementalBakeInstructions, BlobAssetStore, BakingSettings, GameObjectComponents&) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:839)
Unity.Entities.BakingSystem:Bake(IncrementalBakingChangeTracker, GameObject[]) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakingSystem.cs:155)
Unity.Entities.BakingUtility:BakeScene(World, Scene, BakingSettings, Boolean, IncrementalBakingChangeTracker) (at ./Library/PackageCache/com.unity.entities/Unity.Entities.Hybrid/Baking/BakingUtility.cs:84)
Unity.Scenes.Editor.LiveConversionDiffGenerator:Bake(BakingFlags) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionDiffGenerator.cs:189)
Unity.Scenes.Editor.LiveConversionDiffGenerator:UpdateLiveConversion(Scene, Hash128, LiveConversionDiffGenerator&, LiveConversionMode, UInt64, GUID, IEntitiesPlayerSettings, LiveConversionChangeSet&) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionDiffGenerator.cs:431)
Unity.Scenes.Editor.LiveConversionConnection:AddLiveConversionChangeSet(LiveConversionDiffGenerator&, Hash128, List`1, UInt64, LiveConversionMode) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionConnection.cs:404)
Unity.Scenes.Editor.LiveConversionConnection:Update(List`1, NativeList`1, NativeList`1, LiveConversionMode) (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionConnection.cs:369)
Unity.Scenes.Editor.EditorSubSceneLiveConversionSystem:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/EditorSubSceneLiveConversionSystem.cs:62)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:723)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:681)
Unity.Scenes.Editor.LiveConversionEditorSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Scenes.Editor/LiveConversion/LiveConversionEditorSystemGroup.cs:15)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:723)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ComponentSystemGroup.cs:681)
Unity.Entities.InitializationSystemGroup:OnUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/DefaultWorld.cs:169)
Unity.Entities.SystemBase:Update() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/SystemBase.cs:418)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at ./Library/PackageCache/com.unity.entities/Unity.Entities/ScriptBehaviourUpdateOrder.cs:523)
 
That relates to adding a GameObject task to a DOTS entity. I will throw a better error in 2.0.2 but for entity tasks make sure the border of the node is green.
 
Back
Top