OBJ Collision Generator Plugin

Hey. If you use MeshParts for your level’s geometry then you’re probably familiar with the problem of collision meshes being unusable:

One common way to get around this limitation is by importing the mesh as a bunch of wedges! While there are already plugins that do this (.OBJ Importer, by TheNexusAvenger and .obj → wedges, by ThanksRoBama, they have some problems:

  • .OBJ Importer doesn’t support meshes that have faces with more than three vertices (i.e. they have to be triangulated before exporting).
  • .OBJ Importer renders triangles incorrectly. Both also don’t take face normals into account, so the edges are offset slightly. This creates gaps between triangles.
    image
  • Both don’t support non-uniform scaling. .obj ->wedges doesn’t support scaling at all.
  • Both require you to copy-paste the .obj file instead of being able to import them directly.
  • Both render the mesh facing the wrong way (rotated by 180 degrees in the Y-Axis).
  • Both don’t allow you do configure the “thickness” of the resulting mesh.

To solve these problems, I wrote this plugin! Here’s a demo:

Some stuff you should know when using this plugin:

  1. Do not use these for very detailed meshes! This is really only meant for stuff like terrain. If you want to use these for structures, then I would recommend that you use a low-detailed version of the structure when generating the collision parts. The number of wedges that the plugin will generate will be listed in the preview.
    image
  2. The parts rendered by this should be set to be rendered invisible since you really only care about the collision, not the appearance. I only rendered them as visible for demonstration.
    image
  3. For slow computers, it may appear to hang when you’re trying to import a very small (size-wise) mesh that has a lot of triangles.
  4. If you’re using Blender and you’re used to exporting meshes as .FBX instead of .OBJ, you don’t need to set the export scale for .OBJs to 0.01 so that 1 unit = 1 stud.
  5. Set the shell thickness (the thickness of each face) to as thick as you can before the wedges start poking through the surface of the mesh too much.
106 Likes

This will be very useful for easy low-poly terrain, VERY large thank…
:ok_hand:

1 Like

Roblox seriously needs to add custom collision meshes. Their main excuse was always that it would not be as efficient, but this is what we have to resort to.

Either ways, amazing plugin, saved me the trouble of doing this manually.

11 Likes

I’m glad I came across this. I recently had trouble exporting meshes with the right collision and resorted to splitting meshes by objects and adjusting their collisions. This will save me lots of time later on with my projects.

Ever considering making this for .fbx files/meshes?
Else, great plugin!

(Reason I am asking for .fbx support is that I am really struggling to make textures that work with obj’s.)

1 Like

Wow, I am a 3D Artist and this will really help me to create and import my meshes in ROBLOX. It allows me to make sure users are getting the best experience possible now.

Cool plugin! I wrote my own that I’ve been using for awhile and it met its purposes and didn’t have any of the limitations, but it was still tedious because you had to click a button to open a script and then paste the .obj data.

This is a much more intuitive and quick way to go about it, so it’s better for workflows which do this a lot

1 Like

Is there anyway you can increase the thickness render to 4 or above? Having the thickness under 4, made the conversion the smooth terrain glitchy with holes

Why don’t you just set CollisionFidelity to the highest?

They didn’t have PreciseConvexDecomposition in '19

1 Like

Last I tried (a few months ago), it’s still inaccurate/unusable in many situations like super large meshes (like low poly terrain) or complex geometry (like a cube with a hole you can walk inside) so this is also useful for that

3 Likes

Same - I remember I modeled a low poly island (copied a tutorial xd) and when I imported it, the character was walking on air. Seems that convex still isn’t a good fix for large meshes.

2 Likes

Really? I honestly didn’t know that! I also didn’t realize what I posted was more than 2 years after the original release… LOL