Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Change box collider 2D z position?

Discussion in '2D' started by james432213, Nov 9, 2018.

  1. james432213

    james432213

    Joined:
    Jun 14, 2018
    Posts:
    10
    Is it possible to change the z position of the box collider 2D like you can with an ordinary box collider? I would use a box collider (3d) but my player has a 2d box collider and apparently interactions between box colliders 2d and box colliders don't work.

    I want to move the box collider closer to the tip of the spikes.
    boxCollider.png

    Thank you

    (it wouldn't allow me to add "new" tags)
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    You could move the collider to a child object and change the z coordinate for that object.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,333
    Know thought that the Z position of the GameObject it's on has no relevance to the collisions because well, it's 2D physics. All you're going to do is change the rendering for the Gizmo. Hopefully you know this but wanted to be clear.