Search Unity

Game crashes when calling Physics2D.IgnoreCollision

Discussion in '2D' started by Patrascu, Apr 17, 2018.

  1. Patrascu

    Patrascu

    Joined:
    Jan 20, 2016
    Posts:
    59
    Hi there,

    Our game has been crashing a lot lately and every crash dump file is pointing to a call to Physics2D.IgnoreCollision(). We call this function for a lot of objects in our scenes in order to determine what interactions can take place in the game world.

    I've also noticed that we get a lot of these errors in the editor:
    Assertion failed: Assertion failed on expression: 'm_InstanceID != InstanceID_None'

    Any idea what could be the cause of this crash?

    PS We are on Unity 2017.1.2p4, Standalone Windows platform.
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    have you tried using Edit > Project Settings > Physics > Layer Collision Matrix instead?
     
  3. Patrascu

    Patrascu

    Joined:
    Jan 20, 2016
    Posts:
    59
    We are using layers for other purposes, so that is not really an option in our case. Plus, there is a limit of max 32 layers.
     
  4. Patrascu

    Patrascu

    Joined:
    Jan 20, 2016
    Posts:
    59
    We updated to Unity 2017.4.1 and the issue seems to be gone.