Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make 2 boxCollider crossed

Discussion in '2D' started by Leandro95, Mar 20, 2015.

  1. Leandro95

    Leandro95

    Joined:
    Mar 18, 2015
    Posts:
    16
    Hello, I would like to make only two objects with BoxColliders (notTrigger) can be crossed by the other.
    Like a ghost with a player.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,560
    Could you explain that better without the analogy, it's really not obvious what you want. Maybe a picture.
     
  3. Leandro95

    Leandro95

    Joined:
    Mar 18, 2015
    Posts:
    16
    I want that two objects which have boxcollider2d can cross one other without them being triggers.Because they got collisions events with over objects,but when they enters in collisions I want that they cross one other .
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,560
    Collisions are layer-based. You need to have each collider on a different layer and set-up those layer to *not* collide in the collision matrix for 2D found in the 2D physics settings.

    Some more information can be found here.
     
    theANMATOR2b likes this.
  5. Leandro95

    Leandro95

    Joined:
    Mar 18, 2015
    Posts:
    16
    Thanks a lot