Hello I am working with dynamic meshes and procedural meshes in async thread. But adding a lot of triangles creates a big fps drop. With procedural mesh the simple thing of CreatingMeshSection even with few triangles create a drop. Then I wanted to use async tasks to not freeze the Game Thread (with FNonAbandonableTask). But when trying to create a mesh section or when appending buffers to a dynamic mesh. A crash occurs with error Assertion failed: Chaos::CVars::bEnableAsyncInitBody || bIsInGameThread [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PhysicsEngine\BodyInstance.cpp] [Line: 1552]
. So then I wonder how I can make bEnableAsyncInitBody True and if I cannot, what are the other possible ways.
After searching in UE_5.5\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\AsyncInitBodyHelper.cpp
I found the p.Chaos.EnableAsyncInitBody
CVar but READ_ONLY but using the Console Variables Window (see Console Variables Editor) it is possible to edit it, and then make it possible to generate Dynamic Meshes and Procedural Meshes async .
Just chiming in since I ran into the same “read only” issue with the cvar-
p.Chaos.EnableAsyncInitBody = true
is required for the FastGeoStreaming plugin, the game won’t even package without it. The issue with using the console variables window is that it must be re-set via the window every editor session, the cvar is not applied automatically when the editor opens, which is a major annoyance. Instead I opened DefaultEngine.ini and added the line ‘p.Chaos.EnableAsyncInitBody = true’ under the “[/Script/Engine.RendererSettings]” section (though I’m not sure if it actually matters what section you put it under). After doing this I no longer need to re-type the command each time in order for FastGeo to work or to package my game.