Hi,
It is possible to create a very simple blueprint which creates an Import Failed error upon loading a level (via the Editor) which contains an instance of this blueprint.
Steps to reproduce:
1 - Create the file “Kangaroo.cpp” with the following content:
#include "MYPROJECT.h"
#include "Kangaroo.h"
#include "Runtime/Engine/Classes/Components/SplineComponent.h"
AKangaroo::AKangaroo(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = true;
if (this->Role != ROLE_Authority) { return; }
SplineComponent = CreateDefaultSubobject<USplineComponent>(TEXT("Path Cycle"));
check(SplineComponent != nullptr);
}
2- Create “Kangaroo.h” with the following content:
#pragma once
#include "MYPROJECT.h"
#include "Kangaroo.generated.h"
class USplineComponent;
UCLASS(Config = Game)
class ROKH_API AKangaroo : public AActor
{
GENERATED_UCLASS_BODY()
public:
USplineComponent* SplineComponent;
};
3- Compile and launch the Editor.
4- Derive a blueprint from the actor Kangaroo.
5- Drop this blueprint into the current level to instantiate it.
6- Save the level, exit the Editor and restart it on that level.
7- Notice that the OutputLog window now boasts this error message:
LoadErrors:Error: Error /Game/Maps/GameTesting : Failed import for SplineComponent /Game/Developers/LaurentG/Kangaroo_BP.Default__Kangaroo_BP_C:Path Cycle
Cheers,