Problem with Overlaps

Hi,

we have detected a critical problem with any Physics2D.Overlap.

After some calls to this functions, the result is a huge number of bodies (and contact points) into the physics world, and the game starts to run at a very low framerate.

It seems that some objects aren't removed correctly and destroyed.

Devis

Comments

  • Hello @Devis,

    Thanks for the report, we will work to fix this possible bug for the next release (1.0.7).
  • Thanks @JeffersonHenrique.

    Another important features that actually is missing with Overlaps is the overload with a LayerMask.

    I've seen that the body is configured like:

    body.BodyType = Physics2D.BodyType.Static;
    body.IsSensor = true;
    body.CollidesWith = Physics2D.Category.All;

    and so it collides with everything in the scene. It will be useful if we can specifiy a particular LayerMask and filter results accordingly, with a reduced performance cost.
  • Hi @Devis,

    You are right, the last release didn't include a mask option, but we will include it soon, thanks.