Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question How to generate mesh collider for imported 3D model that is more accurate to its shape?

Discussion in 'Editor & General Support' started by farazk86, Dec 5, 2022.

  1. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    Hi,

    I have a rather complex model exported from blender, its a render of a small city. I want to apply some physics simulations to it and that would require it to have colliders. Here is a close up of on of its sections:

    Unity_0XZ0Sbh50m.png

    I want the mesh colliders to be more accurate to its shape, such as individual buildings and such are detected by the mesh colliders.

    When I add a "mesh collider" to this object, it creates something similar to a box collider.. not very helpful

    image_2022-12-05_210942650.png

    Is it possible to add a more accurate mesh collider?

    If not possible as a built in Unity option, can some one kindly suggest an asset that would make this possible.

    Thank you
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,925
    Turn off the "convex" option on the MeshCollider. Though a single concave mesh collider of this size/complexity is probably not going to perform well.
     
    farazk86 likes this.
  3. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    aah.. silly me, thanks for pointing out that convex was the issue.

    Any suggestions on how I can improve the performance of this given its size and collision enabled?