I’m Trying To use my enum which created on pawn class, inside a Interface class
but every time i get compile Error: Expected the name of a previously defined enum
here is my Pawn Class header codes thatimplement my interface function which is a blueprintnative event :
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "ChopperInterface.h"
#include "Chopper.generated.h"
UENUM(BlueprintType)
enum EChopperAttackTypeEnum
{
None UMETA(DisplayName = "None"),
ChopperWeapon UMETA(DisplayName = "Chopper Weapon"),
GunnerWeapon UMETA(DisplayName = "Gunner Weapon"),
RPGWeapon UMETA(DisplayName = "RPG Weapon"),
};
UCLASS()
class SINCEREMEN_API AChopper : public APawn, public IChopperInterface
{
GENERATED_BODY()
virtual void SetChopperAttackType_Implementation(TEnumAsByte NewAttackType) override;
};
and this is my interface class:
#pragma once
#include "CoreMinimal.h"
#include "Engine.h"
#include "UObject/Interface.h"
#include "ChopperInterface.generated.h"
class AChopper;
enum EChopperAttackTypeEnum;
UINTERFACE(Blueprintable, MinimalAPI)
class UChopperInterface : public UInterface
{
GENERATED_BODY()
};
class SINCEREMEN_API IChopperInterface
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, category = "Chopper Interface")
void SetChopperAttackType(TEnumAsByte NewAttackType);
};
when i remove UFUNCTION Property it compiles fine, but i need it to be BlueprintNativeEvent.