A Variable value of Blackboard not applied

In order to check the behavior of the Behavior Graph, I created it as follows.
OnStart() of the Action node returns the ‘OnStart Return’ value, and OnUpdate() returns the ‘OnUpdate Return’ value.

If I expose ‘OnStart Return’ variable, the value set in the Inspector is returned from OnStart(). However, if I set the value in Blackboard without exposing ‘OnStart Return’ variable, the set value will not be returned.

As a result, it means that the Blackboard variable value can only be controlled in the Inspector. If this is a bug, it can be fixed, but if it is not a bug, I don’t think it is necessary to show the value assigned to the variable in the Blackboard. This is because it causes confusion by setting a value that does not work.

Edit: When I restart the Unity editor, it works normally as shown in the image below. In OnStart(), Status.Running is returned by referencing the ‘OnStart Return’ value of the Blackboard, and in OnUpdate(), Status.Running is returned by referencing the ‘OnUpdate Return’ value of the Inspector.

Hi @MOBLIN,

The blackboard should allow using the set value as a default value for the nodes even if it’s not exposed. It’s strange you’re not getting the correct value there! I wonder if having it exposed and then unexposed kept a value that’s overriding the default one, can you try assigning it to a new agent without ever exposing it and see if it just works?

So after restarting the editor it started working fine? That’s confusing!

I cannot reproduce the issue again for now, but I’ve experienced other issues as well.
I made a custom Action node and put the below line in OnStart().

The below code always returned null.
Embedded_Blackboard_Variable.Value = Self.Value.GetComponent();

After restarting Unity Editor, the Animator reference is returned as expected.
This issue is also not reproducible now.

Sounds like setting the value isn’t correctly refreshing the asset for your next run. I’ll take a look and see if we’re missing anything to set the asset as dirty so it doesn’t rebuild before play.

Can you confirm next time if instead of restarting the editor, simply moving a node in the graph editor and pressing play again fixes the issue?

I am sure I set correct type (Animator) to the Blackboard Variable.

I was working on something else and had a problem, so I tried debugging and at some point the value returned from GetComponent() was null.

I checked repeatedly but the problem was not solved, so I restarted the Unity editor again at that time. Many problems are discovered while studying Behavior, and most of them are solved by restarting the Unity editor.