How to fix mesh collision problem?

I made a mesh in blender and tested it out by walking on it but it seems that the collisions are off.


[Images above: Player “floats” in air when walking over the mesh and only steps onto the mesh at the highest and lowest points.]

I understand that it is something about Roblox rounding off the collision, so is there a solution to this?

8 Likes

There have been tons of these threads, and there are many solutions, please use the search tool next time. Here is one explanation and solution:

Here’s another:

And here is my personal approach:

10 Likes

Thanks for the answer, I think I’ve found the solution I’m looking for.


I do want to clarify that I did use the search bar and only managed to find threads from Platform Feedback about improving mesh collision detection.

Anyway, thanks for the solution, now I can continue my development without worrying about how to solve this collision issue. Thanks!

3 Likes

Let me know if the solution works out for you, I am having the same problem.

1 Like

Hello,

Yes, the solution works. What I did, was to gauge which parts looked concave and separate them into two different meshes.

Here’s a visual representation:


[Image 1: Combined together as one mesh, the player walks over the purple area.]


[Image 2: Splitting the parts at concave areas (the purple part) allows for better collisions.]

Do note that if you have irregular meshes just like mine, the more you separate the meshes, the better and more accurate the collision becomes.

4 Likes

Really sorry for bumping this but, i’ve been trying to figure out why my tram mesh for my railway kept having invisible walls, even with precise collision on, i split my mesh in two and it worked perfect after that.
I’m just really curious at why this does this…

2 Likes

Hi, I’m here to share a solution I created.
Open your model in Blender(or any 3d editor)
Duplicate the original model.
then split all the faces of the model (NO need to separate into different objects) and resize them a bit to add some offset between each face.
Import this model to roblox and set the collision fidelity to PreciseConvexDecomposition.
Them use this model as collider for your original model (make it invisible, place in the same position as the original, set the original CanCollide as false … etc).

PS. If the offset is too small it doesn’t work
Maybe You can Import a giant model with good offset and resize it to avoid this problem and get a small offset not sure.

Original Model
image
Collider
image
Final Result

9 Likes

The only one simple enough to use quickly! This solution is awesome. Thank you!

1 Like

i found a solution that will help you save half the usage of that model (you basically needn’t the double copy solution)…

find out how to use this script in blender:

import bpy, bmesh
from bpy import context
from mathutils import Vector

bounding box helper methods

def bbox(ob):
return (Vector(b) for b in ob.bound_box)

def bbox_center(ob):
return sum(bbox(ob), Vector()) / 8

def bbox_axes(ob):
bb = list(bbox(ob))
return tuple(bb[i] for i in (0, 4, 3, 1))

def slice(bm, start, end, segments):
if segments == 1:
return
def geom(bm):
return bm.verts[:] + bm.edges[:] + bm.faces[:]
planes = [start.lerp(end, f / segments) for f in range(1, segments)]
#p0 = start
plane_no = (end - start).normalized()
while(planes):
p0 = planes.pop(0)
ret = bmesh.ops.bisect_plane(bm,
geom=geom(bm),
plane_co=p0,
plane_no=plane_no)
bmesh.ops.split_edges(bm,
edges=[e for e in ret[‘geom_cut’]
if isinstance(e, bmesh.types.BMEdge)])

bm = bmesh.new()
ob = context.object
me = ob.data
bm.from_mesh(me)

o, x, y, z = bbox_axes(ob)

x_segments = 2
y_segments = 2
z_segments = 1

slice(bm, o, x, x_segments)
slice(bm, o, y, y_segments)
slice(bm, o, z, z_segments)
bm.to_mesh(me)

bpy.ops.object.mode_set(mode=‘EDIT’)
bpy.ops.mesh.separate(type=‘LOOSE’)
bpy.ops.object.mode_set()

thank me A LOT later…

1 Like