Hi, I have a problem with the Unreal Engine. I create 2 static meshes for 1 actor, it compiles without errors and both staticmesh are displayed on the class image, but when I place it as an instance of the class, the 2nd staticmesh disappears
AKost::AKost()
{
PrimaryActorTick.bCanEverTick = true;
bGenerateOverlapEventsDuringLevelStreaming = true;
niz = CreateDefaultSubobject<UStaticMeshComponent>("nizKosti");
ConstructorHelpers::FObjectFinder<UStaticMesh> bebra(TEXT("/Game/Modelki/obekti/nizKosti"));
niz->SetStaticMesh(bebra.Object);
niz->SetEnableGravity(false);
niz->SetCollisionProfileName(TEXT("OverlapAll"));
seredina = CreateDefaultSubobject<UStaticMeshComponent>("seredinaKosti");
ConstructorHelpers::FObjectFinder<UStaticMesh> telci(TEXT("/Game/Modelki/obekti/seredinaKosti"));
seredina->SetStaticMesh(telci.Object);
seredina->SetEnableGravity(false);
seredina->SetCollisionProfileName(TEXT("OverlapAll"));
/*seredina->SetRelativeLocation(FVector(0, 0, 25));
}
But if you create a blueprint of this class, then the blueprint is created with 2 staticmesh
And if I uncomment on this passage
/*seredina->SetRelativeLocation(FVector(0, 0, 25));
Unreal engine crashed after this, as if trying to move it, but in fact it does not exist