Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Blender to Unity mesh collider help

Discussion in 'Asset Importing & Exporting' started by Nalig, Oct 20, 2017.

  1. Nalig

    Nalig

    Joined:
    Jun 9, 2017
    Posts:
    1
    Hi there, my name is Gilan and i'm pretty new to importing things from blender -> Unity. I've 1 question: How can i get a good mesh collider or edit it / make my own collider in blender (Look at screenshot). Thanks!

    https://gyazo.com/adef40066856c4f34fda6fa89112890b
     
  2. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Make a copy of your Blender project. In the copy, go to Edit mode on the object you want to process.

    Select Mesh....Vertices....Convex Hull from the menus.

    This will turn your mesh into a nice low-poly convex hull. Delete all its materials, export it, and then use it as the Mesh for the MeshCollider component in Unity.

    If you need a collision mesh for something that is not convex (for example, if that thing in your scene is corridors and rooms), then a convex hull will not work for you. You'll need a low-poly version of your mesh but with the same gross geometry as the visible mesh. You can use Blender's mesh decimation tools to obtain that from a copy of your original. What I actually like to do is go the other way -- I keep my rough prototype low-poly geometry, sculpt it into a higher-poly visible mesh, and recycle the prototype as a low-poly collision mesh.

    ProBuilder also works well for manually creating mesh colliders, and in fact this tool actually has a feature specifically allowing you to mark a ProBuilder mesh as a collider and/or as a trigger.
     
    CashewTheCat likes this.