Hello guys,
I’m developing a generic class for Characters intended to be used by BotCharacters and PlayerCharacters. Unfortunately, I’m struggling to add a new Component (UBoxComponent) visible in both characters as it is not getting editable on blueprint.
I have read many posts on answerhub, but nothing has solved the problem.
The code for GenericCharacter is the following:
UCLASS()
class ARENAPROJECT_API AGenericCharacter : public ACharacter
{
// Default method of all UE classes
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
UBoxComponent* MeleeColisor2;
};
// Implementation
AGenericCharacter::AGenericCharacter(const FObjectInitializer& ObjectInitializer)
:Super(ObjectInitializer)
{
UBoxComponent* MeleeColisor2 = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, "MeleeColisor2");
MeleeColisor2->bEditableWhenInherited = true;
MeleeColisor2->SetupAttachment(RootComponent);
};
After extending that class on BotCharacter, it doesn’t allow to edit. Am I missing something important here?