GEngine not initialized! issue

Get 8 of the bellow error when I startup Ue4(in output log) and when I attempt to cook I also get this issue, It gives very little context around why it is happening or how i can fix it.
"LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with "


): UE4Editor-Cmd: [2016.05.14-12.49.55:926]  0]LogTargetPlatformManager:Display: Building Assets For WindowsNoEditor
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:795]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:795]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:795]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:795]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:796]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:796]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:796]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.57:826]  0]LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with if(!HasAnyFlags(RF_ClassDefaultObject)) or move out of constructor, material parameters will not be correct.
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: [2016.05.14-12.49.58:717]  0]LogCook:Display: Max memory allowance for cook 8192mb

If anyone has run into this issue it would be lovely if you could help

You probably tried to use GEngine->AddOnScreenDebugMessage or another GEngine function in the constructor of one of your classes. This cannot be done, as GEngine has not been initialized yet when they are run.

Hello @Evaned ,
I know its been a while, but did you managed to find the error? Iā€™m having exactly the same problem, 8 "LogPhysics:Error: FBodyInstance::GetSimplePhysicalMaterial : GEngine not initialized! Cannot call this during native CDO construction, wrap with " .

On editor works, but the problem is the packing the game.

Thanks!

Youā€™re doing something in a Constructor or very early in initialization that you shouldnā€™t, such as trying to access a body instances physical material.

1 Like

Hello ,

Is there a way to narrow the search? The log shows only that info. I have been looking for a while but I canā€™t find anything.

Does it apply to BP and C++ classes?

Thanks!

Hello @**msclecram,

Did you manage to find problem?
I have the same issue and I canā€™t figure it outā€¦**

Hello ,

Today I finally found my problem by binary searching over all the repository commits/changes.

I had a body->SetAllMassScale(massScale); on the constructor, I changed it to body->BodyInstance.MassScale = massScale ; and now I can package.

It seems a error easy to make, Iā€™m surprised the small amount of info over the internet. Also the error needs to be more descriptive.

Iā€™m not sure if another functions may cause the same problem, I guess internally they call GetSimplePhysicalMaterial .

1 Like

This advice works. After I temporarily moved the statement of instantiating the material out of the constructor, the packaging was successful. Later, I moved it back to the constructor, and I was surprised that the old bug didnā€™t happen again. Seems to bypass some kind of bug.

Note, to people who are still stuck.

Add a breakpoint on the actual log message (which is located in BodyInstance.cpp, line: 2731).

Then just look at the call stack window via Visual Studio Debugger (Windows > Call Stack). Find the function, which causes this error and fix it.

This took me a couple of hours just to figure it out which plugins or source code was the problem.