Player vs. enemy collision tips

  • I already had “is trigger” set to true on both “player” and “enemy” colliders
  • The “Layer collision matrix” looked ok

and yet, it still didn’t work.

Digging in the doc I noticed that if you only have collider, and no rigid body, on both game objects, it will not trigger OnTriggerEnter2D.
You have to add a RigidBody (2D in our case) to at least one game object in order that it will be triggered at all.

Probably super basic stuff, but sharing anyway in case it helps someone :slight_smile:

Thanks a lot for sharing your tip/solution! :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms