GEngine not initialized! Problem

Hey ,

I had the same error message in my project (4.11.2-2946394+++UE4+Release-4.11). The error mentions the constructor, but other than that it does not give much of a hint what to look for. At first I assumed I did something wrong in my material, where I use a Physical Material. After trying to reproduce this on a new project I figured out that the problem is in one of my constructors, I had: SetMassOverrideInKg(NAME_None, 500.0f, true);

A quick peek at the implementation of UPrimitiveComponent::SetMassOverrideInKg reveals a call to FBodyInstance::UpdateMassProperties(), which in turn calls FBodyInstance::GetSimplePhysicalMaterial(). If you use C++, maybe you could set a breakpoint in the “Engine\UE4” project, at
[\Source\Runtime\Engine\Private\PhysicsEngine\BodyInstance.cpp][1] and check the Call Stack to see how your code ends up there. (Line number may vary based on the engine version, but you can just search for “FBodyInstance::GetSimplePhysicalMaterial” around line 3091.)

I hope this helps someone!

https://github.com/EpicGames/UnrealEngine/blob/c8a4c30acebd28660affb7e8181b9c3247d3edb5/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp#L3091

9 Likes