Assertion failed IsInGameThread() [File:D\build\++UE5\[...]\StaticMeshCompiler.cpp

My project is crashing frequently when compiling and sending out an “Assertion failed IsInGameThread()” error.

Here is the crash log

I think I’m running into the same thing, with a slightly different line number because you’re on UE 5.1 and I’m on 5.3.0 but it’s in the same method. For me it happened when I started a standalone launch of the game from editor. It works fine when I play in editor.

It’s crashing for me here: https://github.com/EpicGames/UnrealEngine/blob/a3cb3d8fdec1fc32f071ae7d22250f33f80b21c4/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp#L369
It’s crashing for you here: https://github.com/EpicGames/UnrealEngine/blob/cdaec5b33ea5d332e51eee4e4866495c90442122/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp#L373
Same check, just line moved.

Did you figure this out?

I tried running standalone game again after this and didn’t hit the same crash. The only difference I can think of is I was using Live Coding previously to make C++ changes to the project and then I started standalone game from editor. When it didn’t crash I didn’t run Live Coding at all in that editor session. Maybe related?

I did.
Someone told me I shouldn’t be using Hot Reloading (basically compiling code with the editor still opened).
But this is really boring and time consuming, so I will still compile with hot reload, and only in case I get a similar error will I close the editor and compile in the IDE.
More info here: https://unrealcommunity.wiki/live-compiling-in-unreal-projects-tp14jcgs

1 Like