Hello,
The code I’m currently writing compiles fine in VS2015 but causes my UE4-Editor to crash as soon as I open it (telling me, im writing functional C++ code, but UE4 doesn’t like it).
I recieve following message:
Fatal error: [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2495] UObject(const FObjectInitializer&) constructor called but it’s not the object that’s currently being constructed with NewObject. Maybe you are trying to construct it on the stack, which is not supported.
UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:414]
UE4Editor_CoreUObject!UObject::UObject() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2496]
UE4Editor_Engine!UDataAsset::UDataAsset() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\dataasset.cpp:9]
UE4Editor_TheImmortal_Demo_7576!URotationAnatomyMap::SetupNewComponent() [c:\users\SOMEGUY\mein zeug\geheimes geheimzeug\theimmortal_demo\source\theimmortal_demo\rotationanatomymap.cpp:30]
UE4Editor_TheImmortal_Demo_7576!APlayerCharacter::APlayerCharacter() [c:\users\SOMEGUY\mein zeug\geheimes geheimzeug\theimmortal_demo\source\theimmortal_demo\playercharacter.cpp:28]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:2728]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:795]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:869]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1027]
UE4Editor_Core!TBaseMulticastDelegate<void>::Broadcast() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:487]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\projects\private\moduledescriptor.cpp:476]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\projects\private\projectmanager.cpp:69]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2577]
UE4Editor!FEngineLoop::PreInit() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:1992]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:127]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build\++ue4+release-4.18+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:253]
kernel32
ntdll
The code I believe to be responsible for this is the following:
void URotationAnatomyMap::SetupNewComponent(FName InComponentName, float InPositiveYaw, float InNegativeYaw, float InPositivePitch, float InNegativePitch, float InPositiveRoll, float InNegativeRoll)
{
URotationAnatomyMapComponent* TempMapComponent = NewObject<URotationAnatomyMapComponent>();
TempMapComponent->SetRotationValues(InPositiveYaw, InNegativeYaw, InPositivePitch, InNegativePitch, InPositiveRoll, InNegativeRoll);
RotationAnatomyMapComponents.Add(InComponentName, TempMapComponent);
}
I just can’t wrap my head around this, literally sitting here for hours, trying to find the error… Do you guys knowwhat I’m doing wrong?
Thanks in advance!