Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to generate custom meshes inside roblox?

I've done a bit of research and all that I could find was about importing already made meshes into roblox, but not a single post saying wether or not you can create your own mesh inside roblox via scripting.

What I mean is wether there is a way to set all vertices and triangles (+UVs) of a mesh similar to what I would usually do in Unity? Or do I need to use Roblox's parts to create a mesh?

I mean studio's terrain generator does just that (and that kind of is what I need it for).

Anyway, thanks in advance for any helpful replys!

2 comments

0

you can create terrain thru scripts, you can create custom unions thru scripts, but you can't move vertices and faces like you would do in blender.

0

I don't need to manipulate vertices, but to create a mesh from scratch with vertice and triangle data.

2 answers

✓ Accepted answer

No, there is no way to procedurally create a MeshPart or access the vertex data of existing Meshes. Studio's terrain generator does not directly generate mesh geometry either, it fills in a 3D voxel grid with materials and occupancy values, and the actual mesh is generated on the fly at runtime by the game's rendering engine, and with distance-based LoD. Different terrain materials use different algorithms for the geometry the generate.

Using the Union to combine Roblox base parts results in a UnionOperation object which is like a MeshPart, but with a couple of key differences:

  1. Unions always have box-mapped UVs, based on the orientation of the first part selected when unioning 1 or more parts. The only control you have over UV mapping is by orienting the first-selected part relative to the rest of the parts, and this UV mapping only determines the orientation of the box-mapping projection, you have no real control over scale of the UVs themselves (though Texture Instances provide UV offsets and multipliers)

  2. Unions do not have a TextureID property, they can only be texture using built-in materials or by adding Texture and/or Decal Instances as children.

  3. Unions can be undone (usually) because they store metadata about the parts they were constructed from.

  4. The internal meshId of a UnionOperation is not exposed and available for use with SpecialMesh/FileMesh/CharacterMesh instances.

A UnionOperation has the same collision and render fidelity options as an imported MeshPart.

It is not possible to make a custom mesh through roblox by Scripting. What I would suggest is for you to get blender; it is a 3D mesh modeling app that a lot of other roblox users use as well.

If you do decide to get blender, I would suggest that you watch some tutorials on how to use it first; that way you 100% understand the functions of this app, and how you can import your mesh through blender to Roblox.

This discussion is preserved as it was. New answers, comments, and votes are closed.