Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    8
    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:
    822
    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:
    1,504
    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.