Enum Variables in BP Actors reset to default on c++ Compile

I have a number of various actors that have an enum variable set to a few different values.

When I recompile my project from visual studio these actors have the Enum variable set back to the default enum value as opposed to the default variable value.

Does anyone have an idea on how to prevent this?

Hi!

Can you, please, show UPROPERTY of this enum on any of the BP actors?

The Enum was created in the editor (not c++), see pictures attached.


image

1 Like

I have actually tested further and the issue is present on closing and reopening the project. Not specifically on c++ compile

Seems to keep both c++ and bp enum values on version 5.3.2

Even tried a mix of a c++ actor with a c++ enum and a later added blueprint enum.



#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "EnumActor.generated.h"

UENUM(BlueprintType)
enum E_Mode
{
	On UMETA(DisplayName = "Turn on"),
	Off UMETA(DisplayName = "Turn off"),
};



UCLASS()
class TESTINGGAME_API AEnumActor : public AActor
{
	GENERATED_BODY()
	
public:	

	AEnumActor();

protected:

	virtual void BeginPlay() override;

public:	

	virtual void Tick(float DeltaTime) override;

	UPROPERTY(BlueprintReadWrite,EditAnywhere)
	TEnumAsByte<E_Mode> ExposedMode;

};

cpp is just default actor class not worth posting.