Search Unity

Collisions problem

Discussion in '2D' started by Ceffa93, Dec 6, 2013.

  1. Ceffa93

    Ceffa93

    Joined:
    Dec 2, 2013
    Posts:
    46
    I have one sprites and one empty object.

    Both of them have a collider2d, with trigger on.

    They have the same Z, so they are effectively interacting

    I call the OnTriggerEvent2D(Collider2D other) method.

    The collision is still not detected. I've done everything right (apparently not -.-) but it is still not working.
    In particular, the method is NEVER called, even a debug.log won't return anything.
     
  2. meta87

    meta87

    Joined:
    Dec 31, 2012
    Posts:
    254
    So you don't have a dynamic rigidbody2D on either gameobject? That won't work unfortunately.

    Here are the valid collisions:

    Static with Dynamic
    Dynamic with Static, Dynamic Kinematic
    Kinematic with Dynamic

    So you always need a dynamic rigidbody to detect collisions or triggers. It's different than the 3d physics.
     
  3. Ceffa93

    Ceffa93

    Joined:
    Dec 2, 2013
    Posts:
    46
    I know all of that, i have tried the rigidbody and the kinematic either, i have the colision/trigger table, the problem is not there...
     
  4. Ceffa93

    Ceffa93

    Joined:
    Dec 2, 2013
    Posts:
    46
    Solved, i restarted unity and it is all ok now...i've no words -.-