When would you want to use Layer-Based Collision Detection and why?

I was reading the Unity Manual and came across the Layer-Based Collision Detection and it sounds awesome but I can’t think of a lot of practical reasons when you would want to use it. Maybe I’m just not thinking creatively right now, if anyone has ideas or suggestions I would appreciate it!

Layer-Based Collision Detection is useful when you want to select what an object collides with. Some examples:

  • A ghost that can be hit with some projectiles but not others.
  • A two-player game where each person has a safe zone. Player 1 cannot enter Player 2’s safe-zone and vice-versa.
  • A game where friendly-fire is disabled. Projectiles pass through teammates but will hit enemies.

Hope this helps.