0
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You should use Pyhsics2D.IgnoreCollision() since Box Collider 2D inherits from Collider2D, not Collider. Found more info here, check this one out.

\$\endgroup\$
2
  • \$\begingroup\$ It does not help. I need dynamic collision enabling/disabling from script. \$\endgroup\$ Commented Jun 1, 2017 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\$ Commented Jun 1, 2017 at 18:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.