My first try = my first big issue

Ashrag

New member
Hello,

our problem is that we are receiving an error message "System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0) ArgumentNullException: Value cannot be null. Parameter name: key" when trying to set the value of a shared variable in our Unity project using the Behavior Designer asset. We have ensured that we have correctly configured the Adaptive Performance settings and the required shared variable is present in the Variables tab.
We are wondering if using the Node scripts shown in the tutorial videos would be helpful for our project, or if there is a different solution to our problem.

Thank you for help.
 

Attachments

  • Behavior Tree.png
    Behavior Tree.png
    61.1 KB · Views: 5
What is the full stack trace of that error? Is that error coming from one of your custom tasks? From your screenshot you have a breakpoint on each node which won't cause problems but I don't think it is what you want.

configured the Adaptive Performance settings
What setting are you referring to?

We are wondering if using the Node scripts shown in the tutorial videos would be helpful for our project, or if there is a different solution to our problem.
You can use the sample nodes without any problems.
 
The full stack trace of the error is:
ArgumentNullException: Value cannot be null. Parameter name: key System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0) System.Collections.Generic.Dictionary2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0) BehaviorDesigner.Runtime.BehaviorSource.SetVariable (System.String name, BehaviorDesigner.Runtime.SharedVariable sharedVariable) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.DeserializeSharedVariable (System.Collections.Generic.Dictionary2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Boolean fromSource, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.ValueToObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Type type, System.Object obj, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.DeserializeObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Object obj, System.Collections.Generic.Dictionary2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.DeserializeTask (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Collections.Generic.Dictionary2[TKey,TValue] dict, System.Collections.Generic.Dictionary2[System.Int32,BehaviorDesigner.Runtime.Tasks.Task]& IDtoTask, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.DeserializeTask (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Collections.Generic.Dictionary2[TKey,TValue] dict, System.Collections.Generic.Dictionary2[System.Int32,BehaviorDesigner.Runtime.Tasks.Task]& IDtoTask, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.DeserializeTask (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Collections.Generic.Dictionary2[TKey,TValue] dict, System.Collections.Generic.Dictionary2[System.Int32,BehaviorDesigner.Runtime.Tasks.Task]& IDtoTask, System.Collections.Generic.List1[T] unityObjects) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.JSONDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadTasks) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <54e4b904ef9a4d4792c51489161280c3>:0) BehaviorDesigner.Runtime.Behavior.CheckForSerialization (System.Boolean forceSerialization


Thank you for your response. Yes, the error seems to be coming from one of the custom tasks. I will try to debug the code further to see where the issue is originating from.

Regarding the Adaptive Performance settings, I was referring to the Unity feature that automatically adjusts the quality settings based on the device's capabilities. We had initially turned it on, but have since turned it off to see if that was causing any issues.

Thank you for letting us know that we can use the sample nodes from the tutorial videos.
 
I may have already fixed that error so I'll send you a new version of Behavior Designer to try. If that still doesn't work can you reply to that PM with your scene/tasks so I can reproduce it? No matter what your task looks like it shouldn't throw that error.
 
We have tried a lot of things and believe we have made some progress, but in the end, we had to delete the entire Behavior Designer from the project for the second time and start from scratch. We are now pursuing a new approach with the Behavior Tree, hoping that through the graphical side, we will finally achieve the desired success.
 
Top