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.
49 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.

3 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.