Blueprint Bitmasks are weird, why?

	UFUNCTION(BlueprintCallable)
	void DoBitTestFunc(UPARAM(DisplayName = "Flags", meta = (Bitmask, BitmaskEnum = "EStates")) int32 Types);

cpp

void AMyActor::DoBitTestFunc(UPARAM(DisplayName = "Flags", meta = (Bitmask, BitmaskEnum = "EStates")) int32 Types) {

	GEngine->AddOnScreenDebugMessage(-1, 1, FColor::Emerald, FString::FromInt(Types));

}

direct

Where EStates is my enum

Returns from passed in bitmask (no needed conversions)

These are the interpreted values from the mask
No flags = 0
Ignore State = 1
No location = 2
Suicide = 4
Immediate Switch = 8
Manual Posses = 16

Full mix = 31 so a correct sum of each element

1 Like