Ok - After talking to the Epic staff this appears to be the correct solution. Posting here so others can utilize this awesome feature!
There does appear to be an inconsistency between the Coding Standards and how the Bitflag enum should be declared. See the Properties Documentation for the proper syntax.
Here is an example of how to declare a Bitflag enum:
UENUM(Blueprintable, Meta = (Bitflags))
enum class EHeroActionTypeFlags
{
Movement,
Attack,
Dodge,
Climb,
CustomReaction,
};
Note that I’m not using the ENUM_CLASS_FLAGS macro any more. Instead I’ve created three macros that handle the testing for me:
#define TEST_BIT(Bitmask, Bit) (((Bitmask) & (1 << static_cast<uint32>(Bit))) > 0)
#define SET_BIT(Bitmask, Bit) (Bitmask |= 1 << static_cast<uint32>(Bit))
#define CLEAR_BIT(Bitmask, Bit) (Bitmask &= ~(1 << static_cast<uint32>(Bit)))
And an example of me using this macro to test if an action is allowed:
if(TEST_BIT(HeroActionsToAllow, EHeroActionTypeFlags::Movement))
{
bMovementAllowed = true;
}
UE-32816 is tracking the issue but as noted this is actually the designed behavior. You need to shift your enum value to do all of your testing, setting, and clearing.