cwossu
(cwossu)
July 31, 2024, 3:02pm
1
Hi, im having a problems with declared enums inside a class not being visible in the BP of that class:
I have these enum declare above the class that uses them:
UENUM(BlueprintType)
enum class ECharacterMovementState : uint8
{
STANDING = 0 UMETA(DisplayName = "Standing"),
CROUCHING = 1 UMETA(DisplayName = "Crouching"),
JUMPING = 2 UMETA(DisplayName = "Jumping")
};
UENUM(BlueprintType)
enum class ECharacterActionState : uint8
{
IDDLE = 0 UMETA(DisplayName = "Iddle"),
BLOCK = 1 UMETA(DisplayName = "Blocking"),
ATTACKING = 2 UMETA(DisplayName = "Attacking"),
HIT = 3 UMETA(DisplayName = "Hit")
};
UENUM(BlueprintType)
enum class ECharacterAttackType : uint8
{
LIGHT = 0 UMETA(DisplayName = "Light"),
MEDIUM = 1 UMETA(DisplayName = "Medium"),
HEAVY = 2 UMETA(DisplayName = "Heavy"),
UNIQUE = 3 UMETA(DisplayName = "Unique"),
SPECIAL = 4 UMETA(DisplayName = "Special"),
SUPER = 5 UMETA(DisplayName = "Super")
};
Then in the class they are here in “public:” :
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = States)
ECharacterMovementState MovementState = ECharacterMovementState::STANDING;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = States)
ECharacterActionState ActionSate = ECharacterActionState::IDDLE;
They work in the code but are not shown anywhere in the blueprint, I can still create them in the variable section.
3dRaven
(3dRaven)
July 31, 2024, 4:41pm
2
If you are using live coding, turn it off. Recompile & run your project
EnumClasses.h
#pragma once
#include "CoreMinimal.h"
#include "EnumClasses.generated.h"
UENUM(BlueprintType)
enum class ECharacterMovementState : uint8
{
STANDING = 0 UMETA(DisplayName = "Standing"),
CROUCHING = 1 UMETA(DisplayName = "Crouching"),
JUMPING = 2 UMETA(DisplayName = "Jumping")
};
UENUM(BlueprintType)
enum class ECharacterActionState : uint8
{
IDDLE = 0 UMETA(DisplayName = "Iddle"),
BLOCK = 1 UMETA(DisplayName = "Blocking"),
ATTACKING = 2 UMETA(DisplayName = "Attacking"),
HIT = 3 UMETA(DisplayName = "Hit")
};
UENUM(BlueprintType)
enum class ECharacterAttackType : uint8
{
LIGHT = 0 UMETA(DisplayName = "Light"),
MEDIUM = 1 UMETA(DisplayName = "Medium"),
HEAVY = 2 UMETA(DisplayName = "Heavy"),
UNIQUE = 3 UMETA(DisplayName = "Unique"),
SPECIAL = 4 UMETA(DisplayName = "Special"),
SUPER = 5 UMETA(DisplayName = "Super")
};
Actor with enum
ActorWithEnum.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "EnumClasses.h"
#include "ActorWithEnum.generated.h"
UCLASS()
class ENUMTEST_API AActorWithEnum : public AActor
{
GENERATED_BODY()
public:
AActorWithEnum();
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = States)
ECharacterMovementState MovementState = ECharacterMovementState::STANDING;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = States)
ECharacterActionState ActionSate = ECharacterActionState::IDDLE;
};
system
(system)
Closed
August 30, 2024, 4:42pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.