Description

We need to, at least, prevent this by clearing observers when running a new BT using a different blackboard. Must also think that this might affect licensees relying on the current behavior (might have created "compatible BB" with similar set of keys)

Steps to Reproduce
  1. Create Blackboard BB_A with the following keys:

1) VectorKey

2) ObjectKey

  1. Create Blackboard BB_B with the following keys:

1) ObjectKey

2) VectorKey

  1. On BeginPlay, run a Behavior Tree using Blackboard (BB_A)
  2. in C++ register an observer

 

FKey ObjectKey= MyBBComponent->GetKeyID(TEXT("ObjectKey"));
MyBBComponent->RegisterObserver(ObjectKey, this, FOnBlackboardChangeNotification::CreateUObject(this, &MyComponent::OnBlackboardObjectChanged));

 

  1. call `AIController::RunBehaviorTree` with a different Behavior Tree using Blackboard (BB_B)

changing `ObjectKey` will no longer call the observer.

changing `VectorKey` will now call the observer registered for `ObjectKey`

 

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - AI - BehaviorTree
Affects Versions5.0
Target Fix5.5
CreatedFeb 7, 2023
UpdatedJan 26, 2024