Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Mesh, terrain or box collider?

Discussion in 'Physics' started by teatreetim, Jan 8, 2020.

  1. teatreetim

    teatreetim

    Joined:
    Nov 8, 2019
    Posts:
    1
    Hi,

    I have terrain mesh that has a simplified version I can use for collision detection. It is in quads (rectangles). I have overhangs and would rather not go the terrain collider route but will do a workaround if it is above and beyond more efficient. The terrain meshes are in the order of a few thousand quads (that don't necessarily stitch at corners but are all aligned so there are no gaps). I could make them into box colliders with a reasonable thickness if this is a good option.

    So the question is, should I use a mesh collider, a set of box colliders or convert the mesh to a terrain height field (or something else I am not aware of). If you think terrain collider by what factor of performance improvement are we talking? A hybrid with a terrain collider and additional boxes could be worked out if that is a good option.

    I am Unity 2019 and can upgrade to 2020 when it is ready if that helps with all the terrain improvements they're working on.
     
  2. marceltmg

    marceltmg

    Joined:
    Feb 6, 2017
    Posts:
    13
    I self using box collider, which i import from blender, so you also need to care about the degree, because the box collider's doesn't addapt a inmesh rotation, just the routation from outside.

    for a terrain i would use a mesh collider, ir would be a lot of work to adjust it with box colliders/also in blender