Description

When creating and declaring a Spline Component in code, placing an instance of a blueprint derived from that class in the level causes a failed import message to appear upon restarting the level.

Steps to Reproduce

1. Open the editor
2. Create a new C++ Actor class
3. Modify your .h code to look like this:

#pragma once

#include "GameFramework/Actor.h"
#include "MyActor.generated.h"

class USplineComponent;

UCLASS()
class SPLINETEST_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	USplineComponent* SplineComponent;

	
	
};

4. Modify your .cpp code to look like this:

#include "SplineTest.h"
#include "Runtime/Engine/Classes/Components/SplineComponent.h"
#include "MyActor.h"


// Sets default values
AMyActor::AMyActor()
{
 	// 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;

	SplineComponent = CreateDefaultSubobject<USplineComponent>(TEXT("Path Cycle"));

	check(SplineComponent != nullptr);
}

5. Compile
6. Open the editor again
7. Derive a blueprint from your Actor class
8. Drop the blueprint into the level
9. Save All and restart the project

Result: Notice you get an Error /Game/FirstPersonCPP/Maps/FirstPersonExampleMap : Failed import for SplineComponent /Game/MyMyActor.Default__MyMyActor_C:Path Cycle

Expected: No error would occur

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

9
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.114.12
Target Fix4.14
Fix Commit3152086
Main Commit3153517
CreatedJul 5, 2016
ResolvedOct 5, 2016
UpdatedApr 27, 2018