- Home /
Mesh Collider won't draw the mesh I am telling it to?
I have an object that I am trying to place a mesh collider on. To do this I have created a slightly smaller (and more basic) 6 sided panel and brought it into Unity with my object to be used to generate a more basic mesh collider than the one that would have been generated had I just used my objects own mesh.
The problem is when I do this, the mesh collider does seem to use the more basic mesh for generating the collider. But it seems to make it bigger? I want my mesh collider to be slightly smaller than my object for gameplay reasons but the mesh collider is too big.
For instance; this is the mesh that is selected in my objects mesh collider window, inside the object I am talking about:
When I turn the collider to 'convex', the blue lines should be green, right?
but instead this happens:
See that it DOES use the mesh I have selected to draw the mesh collider, BUT it has made it bigger to fit around my entire object. I do not want this. Whats up with that?
In my second screen grab you can still see my mesh being used to generate the mesh collider inside my object and it is blatantly smaller than the mesh collider that it has created.
Can anyone help me out and tell whats going on, or how to fix this?
Answer by Radetic · Jul 15, 2015 at 04:54 PM
@Caolan, the MeshCollider component allow you to choose which mesh to use for the collider. For what I can see, your mesh is already convex, so you don't need to checkbox that property. As a final resouce, you can always alter the import settings of the file where you get the mesh from. That should make it smaller as an asset when compared to other assets using the same scale.
Thanks for the reply, I actually need it convex because the game is made up of mesh colliders interacting with each other. I ended up buying a plugin that generates compound colliders automatically. Huge time saver and much more versitile than the default Unity mesh collider. Here is the plugin for anyone interested: Concave Colliders