I created a scene with a bunch of cups and as soon as I add a mesh collider to them, the game comes to a crawl. Is there any way to speed it up?
Only static colliders (Colliders without rigid bodies) should have mesh colliders attached.
If you want to create rigid bodies use primitive colliders.
ok… I deleted all the rigid bodies from the cups and it looks like I have the same problem. ![]()
Hmm.
I can take a look at the performance problem if you submit a bug report on it.
Don’t forget to attach the project folder to it as well.
Thanks for taking a look! ![]()
The problem is that the sphere you shoot against the collide is too finely tesselated in relation to the size of the sphere.
When the ball hits the cup, it will be in touch with thousands of triangles, this creates a lot of contacts, which slows the simulation down.
There are two solutions:
- Use compound colliders, just create boxes and capsules in creative ways as children of your cup mesh. (Dont forget to remove the mesh collider on the cup)
- Create another version of the cup mesh with a lot fewer triangles. Limit it to 50 triangles, then assign the low poly mesh to the mesh collider by dragging the mesh onto the mesh property in the mesh collider inspector.
THANK YOU! I will give them a try!! ![]()
Hmm… ok I am trying solution 2. So… with this solution you are saying I can have a high triangle object rendered with a low triangle collider right?
The file I sent you has two version of the cup. The original “CarniCup” is a high triangle, and the “smCup” object is the low triangle object (not 50 limit yet).
There is a CarniCup on a table and when I drag the low triangle object onto the CarniCup’s Mesh Collider, it just replaces the carniCup with the smCup. The game view shows the smCup. Is there a way to check to see the collider’s mesh as well as the object’s mesh?
Xacto,
You need to be in “Full” mode in the inspector to expose the Mesh Collider mesh - see below. Drag the low res mesh on to this one.
Richard.

Argh! …your right, I had my inspector on simple. :lol:
Thanks!
That thing always gets me too…
I am usually on expert just to make sure…
Btw. expert mode is only useful for debugging scripts. It doesn’t give you any extra editable properties.
The only time I need to use Expert mode is when editing the texture size and depth of a render texture.
-Jon
True. Forgot about that.
Is there a way to actually see the mesh in the mesh collider in unity? ( hi-rez mesh with a low rez collider)
Everything was working perfectly, then all of a sudden my two meshes do not fit together anymore - its acting like a box collider now. I have a back up, so no big deal, but it would be nice to make sure they are matching up visually.
Instead of adding the mesh collider to the high polymesh,
add the low polymesh with a mesh renderer and everything as a child of the high polymesh.
Then they both get renderered. Once your are happy with it, remove the mesh renderer from the low poly version.
Btw. when i looked at your project, it contained skinned mesh filters for the cups. You might want to remove those again.
[quote="Joachim Ante"add the low polymesh with a mesh renderer and everything as a child of the high polymesh. [/quote]
Ah, great tip… that will work!!!
And about the skinned mesh filter… I did not know I could delete that. What does that actually do anyway… could not find that in the manual.
Thanks again for all the help!
It is used when doing character animation. I guess when you imported the mesh it had some kind of character skin attached.
I did as suggested and loaded my low polymesh as a child of the high polymesh and it told a lot about my problem. Again… great tip!
Some how, my low mesh had a diferent rotation then my high mesh. I have been modeling in Modo, exporting it to Lightwave for saving it as a FBX file. (so things could get messed up – ugh!)
Now my question is… is there a way to rotate the low mesh to match my high mesh in unity (like transform), or will I have to adjust rotation in lightwave?
Just rotate it. There is nothing special about colliders attached as children to other objects.
You have set it up as a child of the real mesh right?