Hi,
I have a blackboard decorator node in my behavior tree that’s set to abort “Both”. It’s observing an Actor.
When the observed Actor is destroyed in the level, the associated Blackboard Key immediately updates to None. But the decorator node fails to abort. This is true when I have Notify Observer set to either “On Result Change” or “On Value Change”.
I tried this in 4.15, 4.16, and 4.17; it happens in all of them.
Is this expected behavior? If so, how should I properly handle informing my behavior trees that their observed Actors are no longer valid when those Actors get destroyed?
Steps to reproduce:
- Create a new Third Person project
- Create a new blackboard asset, then add a new key (Key Type: Object. Base Class: Actor)
- Create a new behavior tree asset (see image below)
- Create a new AIController and have it RunBehaviorTree (from Event BeginPlay)
- Create a Pawn, place it in the default level (ThirdPersonExampleMap), and set its AI Controller Class to the one created above
- Use the Level Blueprint to set the value of the blackboard key (from step 2) to be the ThirdPersonCharacter in the level.
- On the ThirdPersonCharacter, set the Initial Life Span to 10.0
- Press Play. After 10 seconds, the ThirdPersonCharacter (i.e. the observed value) will be removed. But the blackboard decorator node in the behavior tree will fail to abort.