Getting blackboard value by ID fails, but by name works

Hi,

I have a weird one where this call always returns 0.0:

const float theValue = MyBlackboard->GetValue(SomethingRandom.GetSelectedKeyID());

But this works:

const float theValue = MyBlackboard->GetValueAsFloat(SomethingRandom.SelectedKeyName);

It’s using the same key in both places and if I attach to the editor everything looks fine.
My key is declared like this:

UPROPERTY(EditAnywhere, Category = Blackboard)
struct FBlackboardKeySelector SomethingRandom;

And the only other modification to it is this:

SomethingRandom.AddFloatFilter(this, GET_MEMBER_NAME_CHECKED(UBTTask_MoveCloseTo, SomethingRandom));

Any ideas why this would be?

Thanks,
Dave

Perfect, thank you.

When manually using FBlackboardKeySelector as property type you need to tie it to a specific BB asset to convert key names to IDs. You need to call FBlackboardKeySelector.ResolveSelectedKey as soon as you get access to BB component, or the BB asset (you can for example extract it from the BT information).

Cheers,

–mieszko