Search Issue Tracker

Active

Under Consideration for 1.0.X

Votes

0

Found in [Package]

1.0.9

Issue ID

BEHAVB-317

Regression

No

Setting a shared blackboard variable in the game object inspector throws an error

Package: Unity Behavior

-

*Steps to reproduce:*
# Create and open a behavior graph
# Add a blackboard variable
# Set the shared toggle to true and make sure exposed is also on
# Add a behavior graph agent in the game object hierarchy
# Assign the graph
# Set the shared variable in the agent component to anything else

*Actual results:* The console throws an error

*Expected results:* No error is thrown in the console

*Reproducible with versions:* 1.0.9

*Tested on (OS):* MacOS

*Notes:*
* It should probably not be editable from the inspector in the first place

*Stack trace*
{code:java}
NullReferenceException: Object reference not set to an instance of an object
Unity.Behavior.SharedBlackboardVariable`1[DataType].SetValue (DataType newValue, System.Boolean notifyChange) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Runtime/Execution/Blackboard/SharedBlackboardVariable.cs:183)
Unity.Behavior.SharedBlackboardVariable`1[DataType].SetObjectValueWithoutNotify (System.Object newValue) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Runtime/Execution/Blackboard/SharedBlackboardVariable.cs:167)
Unity.Behavior.BehaviorGraphAgentEditor.SetBlackboardVariableValue[DataType] (Unity.Behavior.BehaviorGraphAgent agent, Unity.Behavior.BlackboardVariable refVariable, DataType newValue) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Editor/Inspectors/BehaviorGraphAgentEditor.cs:846)
Unity.Behavior.BehaviorGraphAgentEditor.UpdateValueIfChanged[DataType] (DataType currentValue, Unity.Behavior.GraphFramework.SerializableGUID varID) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Editor/Inspectors/BehaviorGraphAgentEditor.cs:701)
Unity.Behavior.BehaviorGraphAgentEditor.DrawFieldForBlackboardVariable (Unity.Behavior.BlackboardVariable variable, System.Boolean isOverride) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Editor/Inspectors/BehaviorGraphAgentEditor.cs:306)
Unity.Behavior.BehaviorGraphAgentEditor.DrawBlackboard (System.Collections.Generic.IEnumerable`1[T] variables) (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Editor/Inspectors/BehaviorGraphAgentEditor.cs:288)
Unity.Behavior.BehaviorGraphAgentEditor.OnInspectorGUI () (at /Users/kristinnbragi/gitrepo/behavior/Packages/com.unity.behavior/Editor/Inspectors/BehaviorGraphAgentEditor.cs:164)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass79_0.<CreateInspectorElementUsingIMGUI>b__0 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:747)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:219)
{code}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.