How can I make one Box Collider 2D go through another one in Unity? I tried this, but it seems to work only for ordinary Box Collider, but not for Box Collider 2D.
\$\begingroup\$
\$\endgroup\$
2
You should use Pyhsics2D.IgnoreCollision()
since Box Collider 2D inherits from Collider2D, not Collider. Found more info here, check this one out.
-
\$\begingroup\$ It does not help. I need dynamic collision enabling/disabling from script. \$\endgroup\$ – qqqqqqq Jun 1 '17 at 18:26
-
\$\begingroup\$ I have changed the answer completely, since you have asked for dynamic collision handling. May be this one will help \$\endgroup\$ – Tolga Şen Jun 1 '17 at 18:36