Hello,
I wrote a simple c++ actor which should spawn a weapon on a regular basis and extended it with a blueprint.
If I place it in the level, close the map and reopen it I get the following error:
LoadErrors:Error: Error Failed import: SceneComponent /Game/Blueprints/WeaponSpawnerBlueprint.Default__WeaponSpawnerBlueprint_C:Root in /Game/Maps/map01
The code of the c++ class is nothing exceptional: it spawns a scene component and a box collision component.
WeaponSpawner.cpp
....
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;
sceneRootComp = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("Root"));
SetRootComponent(sceneRootComp);
pickBox = PCIP.CreateDefaultSubobject<UBoxComponent>(this, TEXT("Box Collider"));
pickBox->SetBoxExtent(FVector(collisionDistance, collisionDistance, collisionDistance));
....
WeaponSpawner.h
....
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component")
TSubobjectPtr<USceneComponent> sceneRootComp;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Spawner")
TSubobjectPtr<UBoxComponent> pickBox;
....
Needless to say, the overlap event never gets called and the box is not shown in editor.
Any idea on what happened?
Thanks,
Riccardo.