Hello everyone. I have two C++ classe.
One is a SplinePipe, the other one is a SplineObjectTrackGenerator. They both inherit from AActor.
When I tried to instantiate SplinePipe as a component of SplineObjectTrackGenerator, I thought I could use something like:
ASplinePipe* pipe = CreateDefaultSubobject<ASplinePipe>(TEXT("Pipe"));
But even though this compiles, it crashes the game when it starts. I narrowed down the crash to being caused by the line above, it seems.
Here is the error message
Fatal error: [File:D:\Build\++UE4+Release-4.15+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp] [Line: 117]
No object initializer found during construction.
UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
UE4Editor_CoreUObject!UObject::CreateDefaultSubobject() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:118]
UE4Editor_ImBack_2481!ASplineObjectTrackGenerator::BeginPlay() [c:\users\lord of xy\documents\unreal projects\imback\source\imback\splineobjecttrackgenerator.cpp:46]
UE4Editor_Engine!AActor::DispatchBeginPlay() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\actor.cpp:3097]
UE4Editor_Engine!AWorldSettings::NotifyBeginPlay() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\worldsettings.cpp:183]
UE4Editor_Engine!AGameStateBase::HandleBeginPlay() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\gamestatebase.cpp:177]
UE4Editor_Engine!UWorld::BeginPlay() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\world.cpp:3435]
UE4Editor_Engine!UGameInstance::StartPlayInEditorGameInstance() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\gameinstance.cpp:338]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [d:\build\++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\playlevel.cpp:3420]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [d:\build\++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\playlevel.cpp:2515]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [d:\build\++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\playlevel.cpp:1215]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1522]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:391]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3025]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build\++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll
Does anyone recognize this as a common problem? I feel like this is a simple fix, but I just don’t know the right function or syntax.