Download

Blackboard and enum in code

Hey so I’m trying to use an enum in my code in my blackboard so I can use it in my AI behaviour tree and I typed the same enum name, it seems to have got it but it won’t change from the first value of the enum even when I change it in code no matter what. It just stays at the first same value.
Please can someone help me fix this issue, thank you! :smiley:

Post a code sample of the C++ and we’ll see what we can do.

UENUM(BlueprintType)
enum class ECurrentAIMode : uint8 {
CHASING UMETA(DisplayName = “CHASING”),
OFFENSIVE UMETA(DisplayName = “OFFENSIVE”),
DEFENSIVE UMETA(DisplayName = “DEFENSIVE”),
AMBUSH UMETA(DisplayName = “AMBUSH”),
SCATTER UMETA(DisplayName = “SCATTER”)
};

Thats the enum and it is defined as:
ECurrentAIMode CurrentAIMode = ECurrentAIMode::DEFENSIVE;

OnPaste.20210610-072202
Then in the behavior tree + blackboard, it gets the current ai mode but it won’t change from the first element in the list which is CHASING

Take a screen shot(s) of the BluePrints where these are used.

1 Like

Its okay, thanks for the help anyways, I forget to do Blackboard->SetValueAsEnum! :smiley: