Description

I was testing some behavior tree content and wanted to temporarily disable a behavior tree entirely. So, I disconnected the root node from the selector node below it and expected that to disable the behavior as nothing was connected. However, this actually had 0 effect and the behavior tree continued to operate like the root node was connected. None of my other changes had any effect either after this point.

The issue is that in UBehaviorTreeGraph::UpdateAsset it only tries to actually update the behavior tree model if the root node is connected to a selector node. Because I disconnected the root node, it no longer got into the logic that tried to rebuild the graph and the model was out of sync with the editor. Disconnecting the root node should either do something or create an error saying you are in a broken state. There doesn't appear to be a good way to temporarily disable tree so I added a wait 300 node instead

Steps to Reproduce
  1. Load some test content that uses behavior trees, confirm it is working
  2. Open behavior tree asset used in content, disconnect top node. It looks like nothing should be happening because nothing is connected
  3. Play again, confirm that test content still works as if the nodes were connected, when user expects behavior to be disabled

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-97749 in the post.

2
Login to Vote

Fixed
ComponentUE - AI - BehaviorTree
Affects Versions4.26
Target Fix5.2
Fix Commit23532163
Main Commit23532163
CreatedAug 27, 2020
ResolvedDec 15, 2022
UpdatedFeb 4, 2023