Create Mesh from Code

It is currently not possible on Roblox to create a mesh from code. This is a feature in many other Game Engines and would be great to be in Roblox Studio too.

An example of how a mesh could be formed from code is:

local vertices = {Vector3.new(0,0,0), Vector3.new(1,0,0), Vector3.new(0,1,0), Vector3.new(1,1,0)}

local triangles = {1, 2, 3, 3, 4, 5}

local mesh = Instance.new("MeshPart", workspace, vertices, triangles)

I’m sure this would benefit many developers. I am currently working on a game with custom terrain, this feature would benefit me because it would allow me to make this terrain up with multiple meshes rather than hundreds or thousands of wedges; this would also cut down the polygon count in my game by 8 times, 1 polygon rather than an 8 polygon wedge.

This could also fit hand in hand with another feature request I’ve seen here for level of detail meshes, where you can upload multiple meshes to a mesh part for different level of details rather than automatically generated lower polygon meshes. Along with this request you could make the meshes for different mesh part level of details from code.

4 Likes

A post was merged into an existing topic: API to create and modify meshes during runtime

Duplicate