0
\$\begingroup\$

I wanted to set up the layers that my Player interacts with, but it still triggers with unwanted layers. I have disabled the whole collision matrix in project settings:

Blank layer collision matrix

Here's my Player settings:

Inspector for player object on player layer

And ProjectileCleaner settings:

Inspector for projectile cleaner object on projectile cleaner layer

I have this script attached to the 'Player' gameObject, but my Player still triggers with the 'ProjectileCleaner' layer. Why?

public class PlayerCollisionController : MonoBehaviour
{
    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("trigger: " + other.name);
    }
}
\$\endgroup\$
2
  • 1
    \$\begingroup\$ Do you have some Layer Overrides enabled on collides? \$\endgroup\$
    – Nikaas
    Commented Jan 6 at 10:39
  • \$\begingroup\$ @Nikaas nope, but thanks for the idea, I've just excluded the layer. Works fine. \$\endgroup\$
    – Argamidon
    Commented Jan 6 at 13:37

1 Answer 1

1
\$\begingroup\$

You're in the Physics section of the Project Settings but you're using Physics 2D. You need to edit the matrix in the Physics 2D section.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .