UBlackboardComponent::IsValidKey does not check for parent keys.

So this engine function in BlackboardComponent.h:

PRAGMA_DISABLE_DEPRECATION_WARNINGS // re BlackboardAsset
FORCEINLINE bool IsValidKey(FBlackboard::FKey KeyID) const { check(BlackboardAsset); return KeyID != FBlackboard::InvalidKey && BlackboardAsset->Keys.IsValidIndex(KeyID); }
PRAGMA_ENABLE_DEPRECATION_WARNINGS // re BlackboardAsset

Is giving unexpected behavior when combined with UBlackboardComponent::GetKeyID.

I’ll explain:

GetKeyID does a lookup in the whole Blackboard asset tree (including all parents) to determine the KeyID. This is an idea in the complete inherited list of keys.

IsValidKey checks (if this KeyID is not the InvalidKey and) is a valid index for the current blackboards Key list.

You can see where the problems arises:
The Retrieved KeyId could be an index not inside the current BB key list (if eg. this blackboard did not add any new keys).

The disabling of deprecation warnings tells me the actual function is not really to be used safely (also could not find any references in the engine), however I could not find any explanation on the repository on the reason why.

I just wanted to give a heads up on this. Also will try to do a pull request with a working IsValidKey function.

I see on UE5-Main branch this has been fixed [Commit 23074d7].
Hope this gets into a release version soon.