I was thinking that I would make all the hard logic in C++ and visual setup (positions, dimensions etc) in BP. So I made a simple empty project where I have a tank actor having 2 components. Then I overriden this C++ class into BP but I can’t edit anywhere. As you can see in the image below… so what am I doing wrong??? BTW I figured out that when I add the C++ actor to scene and turn it into a reusable blueprint then suddenly I can change the inherited components… so is that the correct way? If so what is the Override C++ class good for
The source code:
ATankBase::ATankBase()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
BodyComponent = CreateDefaultSubobject<UBoxComponent>(TEXT("BodyComponent"));
RootComponent = BodyComponent;
CannonComponent = CreateDefaultSubobject<UBoxComponent>(TEXT("CannonComponent"));
CannonComponent->AttachTo(BodyComponent);
}
Header code:
UPROPERTY(EditAnywhere)
UBoxComponent* BodyComponent;
UPROPERTY(EditAnywhere)
UBoxComponent* CannonComponent;
The image looks like this: