Search Unity

Custom shaped colliders

Discussion in 'Physics' started by TheCelt, Oct 19, 2016.

  1. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Hello

    I was wondering if there is a way to create a custom shaped collider some how ? I have areas with layouts that make L, T and + shapes, and need a trigger collider to match this layout so i know when a character is in a given area.

    The areas are grid layouts so the data for their layout is stored in a 2D grid.

    What would be the best way to do create custom shaped colliders for this situation?
     
  2. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    You can either use a combination of primitive colliers (box, sphere, capsule) for the majority of your collision and trigger needs as they are the cheapest.

    If you really do need more accuracycle their are two plugins that would help you out, K-DOP Collision Hull Generator and Concave collided, but try to use them as sparingly as you can as they are more expensive than primitive colliders:

    K-DOP Collision Hull Generator:
    https://www.assetstore.unity3d.com/en/#!/content/70132

    Concave Collider:
    https://www.assetstore.unity3d.com/en/#!/content/4596
     
  3. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Hmm the shapes are pretty simple so thinking those assets are more like mesh colliders which is bit too heavy.

    I can't use multiple colliders unless they can be merged into one single collider some how ?
     
    makai15 likes this.
  4. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    The K-Dop collider has a lot of settings to simplify the collider, you could also create your own simple colliders in something like probuilder or any 3D modeling software.