How to create StaticMesh Programmatically

I would like to create StaticMesh in my game from polygonal data that I generate programmatically. Is it possible to do so in Game mode, and not just Editor mode?

I’ve found that FRawMesh gives the lowest level access to a mesh’s polygonal data. I haven’t yet found how to create a FRawMesh. If there’s a way to do it, is it possible to do it in a Game, and not just editor (i.e. outside WITH_EDITOR macro)?

Check out - Procedural Mesh | Unreal Engine Documentation

There’s an example with code in this thread - Generate Procedural Mesh - C++ - Epic Developer Community Forums

Procedural meshes aren’t ready for production - they’re severely limited and in many cases don’t work right.

I’d be keen to see something more complete about static mesh creation as well, but right now one of the better options is to read through StaticMeshEdit.cpp.