Search Unity

orthographic cam with 45 degree - z-index problem

Discussion in '2D' started by BMYU, Mar 26, 2017.

  1. BMYU

    BMYU

    Joined:
    Jun 17, 2014
    Posts:
    11
    Hi. I am creating a cool 2d game like enter the gungeon.

    What I want to do is, this one. https://pbs.twimg.com/media/CDz7jp9WEAEMcpw.png:large

    So I set my cam orthographic rotated with 45 degree
    http://imgur.com/usu5dCy
    that is,
    http://imgur.com/a/eI6YH


    And here is the problem.

    In the scene, there're two object. green capsule and gun.
    (having same sorting layer and order in layer)
    http://imgur.com/AsWQA2Y
    The position of green capsule object is [310, 276, -25]
    and the position of gun is [295, 271, 0]

    Sure, it looks like this in game view. green one is under the gun object. since the y position is bigger.
    http://imgur.com/B2ZAT8a

    but when I increase y position of the gun to 274,
    http://imgur.com/cEuv2Yl

    http://imgur.com/hkg8hlL
    It renders weird. gun is now under the capsule.

    Is this a unity3d bug?
     
    Last edited: Mar 26, 2017
  2. BMYU

    BMYU

    Joined:
    Jun 17, 2014
    Posts:
    11
    + I am using 2d toolkit which means sprite is rendered by Mesh renderer.

    1.JPG