Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Multiple paths in EdgeCollider2D

Discussion in '2D' started by TFlippy, Jul 11, 2017.

  1. TFlippy

    TFlippy

    Joined:
    Nov 12, 2014
    Posts:
    27
    Is it possible to have multiple separate paths in EdgeCollider2D that aren't connected without making extra GameObjects, similiar to PolygonCollider2D?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    3,551
    Just use multiple EdgeCollider2D components on the same GameObject.
     
  3. TFlippy

    TFlippy

    Joined:
    Nov 12, 2014
    Posts:
    27
    I can't add multiple components of same type to the GameObject with AddComponent - "Already contains a component".
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    3,551
    You certainly can add as many Circle, Edge, Box, Polygon and Capsule colliders as you like to a GameObject. Only CompositeCollider2D restricts to a single one.
     
  5. TFlippy

    TFlippy

    Joined:
    Nov 12, 2014
    Posts:
    27
    Oops, nevermind. I just realized that this was added by me.
     
unityunity