Other compilation error(5)

UENUM(BlueprintType)
enum class EAnimationState
{
ERunning UMETA(DisplayName= “Run”),
EAttack UMETA(DisplayName = “Attack”),
EDying UMETA(DisplayName = “Dead”)
};

UCLASS()
class NEVERUST_API UUnitAnimInstance : public UAnimInstance
{
	GENERATED_BODY()

	UUnitAnimInstance();
	void GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const;
	
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Test")
		EAnimationState animState;
	
};

Why does this cause OtherCompilationError(5)?

Hello WMP,

There are a couple of errors in this code as far as I can see.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Test")
         EAnimationState animState;

The above line needs to be public if you’d like to use BlueprintReadWrite. Also, EAnimationState will not work, as the error in the output log will report. You need to use this instead:

TEnumAsByte<EAnimationState> animState;

Also, in your .cpp, you’ll need to actually implement your GetLifetimeReplicatedProps function, as shown below:

void UUnitAnimInstance::GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
}

Finally, ensure to include UnrealNetwork.h in your .cpp file.

When I did all of this, the project compiled successfully.

Have a great day