I have a prefab that has a Behavior Agent Component.
The prefab is under git control so i can very well see when the prefab is persited with a change.
Now when I change the Behavior Graph field (select a different graph / select “None”). Nothing changes on disk. No changes in git.
Also (and this is of course the logical consequence of this bug) the instance of the prefab in my scene does not change.
Guys this is a monster bug. Dont get me wrong, I find this Behavior Package extremely good and I was able to migrate my Behavior Graph from NodeCanvas, which I previously used.
I also investigated further and observed, that the object is persisted as soon as I change a variable in the Blackboard. But in my usecase, all Blackboard Variables are on their default values when the game starts and they only get set at runtime.
Steps to reproduce:
Create (empty) TestBehaviorObject in the Scene.
Make a prefab out of it.
Add a Behavior Agent component to the prefab.
Create a new BehaviorGraph in Assets.
Drag drop this new BehaviorGraph into the “Behavior Graph” field of the Behavior Agent component of the prefab.
Expected outcome:
The TestBehaviorObject in the scene references the BehaviorGraph.
Actual outcome:
it does not.
Conclusion:
The Behavior Graph field of the Behavior Agent Component does not comply with the standard unity prefab workflow.
FYI I’ve got a fix for it. It’s in review. It also brings in more expected prefab workflows like reverting and overriding. I’ll see when it can come in, hopefully next week.