Search code examples
unreal-engine4game-developmentunreal-blueprintunreal-engine5

Unreal Engine - Let player import their own 3D models/meshes into the game


Similar to what you could do in Second Life, I'd like build an online multiplayer game with Unreal Engine where the player can import his own 3D models into the game (create his own environment) and position them the way he wants, import his own textures, etc.

The other online players would then see the newly imported 3D model the same way its owner does.

Is this doable with UE4/UE5? If not, which game engine should I be looking into?

Thank you!


Solution

  • This task requires two separate things: importing mesh data from a file, and displaying the mesh data.

    For importing mesh data, it's possible to use the open-source cross-platform 3D file import library, assimp. You need to compile it for needed platform (the documentation of the library is good, it describes how you can do that in detail). Then you need to include the binaries/includes in the engine: help for that here (and elsewhere on the internet, just search "include third-party library in Unreal).

    Assimp can import many file types, and give you arrays of vertex positions, UVs, normals, as well as triangle data. This data then needs to be displayed.

    For displaying mesh data, you can use Procedural Mesh Component which is included in the engine, or a free open-source alternative, which has several improvements: Runtime Mesh Component.

    Those components have functions such as CreateMeshSection, which have as input parameters those same arrays of vertices/uvs/etc.

    Specifics of the implementation depend on your needs. Documentation of these libraries will help.