Search Unity

[C#][Physics2D] multiple colliders and OnCollisions on one gameobject

Discussion in 'Physics' started by agostonr, Aug 21, 2016.

  1. agostonr

    agostonr

    Joined:
    Jan 3, 2016
    Posts:
    193
    Greetings,
    I understand this has been asked but that post was old. I have a gameobject and I want it to have two colliders, (either on same GO or on a child GO) and what is more important, I want to use ONE script, that can distinguish between the two colliders. Is this possible? Regards
     
  2. StarByteGames

    StarByteGames

    Joined:
    Dec 21, 2015
    Posts:
    23
    Just use different tags for each collider and have your script search for tags :)