Deleted assets will cause Behavior Graph file to corrupt

Hello dear Unity developers!

I noticed that if I create Actions/Conditions/Enums within the Behavior Graph, and then use them in the current Graph or Subgraphs (add them in the blackboard as variables and use in the Graph itself), and then if I delete these new Actions/Conditions/Enums in the Unity Editor (e.g. if I created better Actions, or I just don’t need them anymore), the Behavior Graph will be corrupted.
It will not be possible to work in it since all the nodes disappear and Console will be throwing errors.

If you have time, could you please integrate a “Missing” feature? So that in the Behavior Graph I will see the deleted Actions/Conditions/Enums as Missing instead of the whole Graph corrupted. The workaround right now is to make a new Graph with new Actions/Conditions/Enums that you created (but it’s a big waste of time).

I am sorry that I cannot provide you a template project or name these errors, but the reproduction steps are pretty easy:

  1. Create Behavior Graph
  2. Create Actions/Conditions/Enums
  3. Add these Actions/Conditions/Enums to the Blackboard
  4. Use these Actions/Conditions/Enums in the Graph and Subgraphs
  5. Delete the Actions/Conditions/Enums code in the Unity Editor
  6. Re-open the Behavior Graph and Subgraphs and notice that they are corrupted

Behavior Version: 1.0.7
Unity Version: 6000.0.25f1

Thank you!

Hi @unity_30D89FB79A72844A3914

Thanks for reporting the issue, we do actually have a placeholder mechanism to handle such scenarios, so it might be a regression. I will open a ticket using the information you provided.

Sorry for the inconvenience :bowing_man:

1 Like

I’ve also encountered a weird issue (not sure if it’s related to this), where after restarting the editor the Behavior Agent on a prefab would become “missing”. If i performed a build and started the game it would crash saying Asset0 has been modified. Re-making the whole behavior tree seems to have made it go away :thinking:

:grimacing:

Sounds like we might be missing an asset check before building the player. Could you open a bug report for this second issue please?

1 Like

Hey @unity_30D89FB79A72844A3914, I think I’ve managed to reproduce your issue. Here is the link to the issue tracker for the bug.