Search Unity

Problem rotating sprites in x or y axis

Discussion in 'Editor & General Support' started by JesusMartinPeregrina, Feb 22, 2014.

  1. JesusMartinPeregrina

    JesusMartinPeregrina

    Joined:
    Nov 2, 2013
    Posts:
    44
    Hi guys.
    Im developing a 2d cards game. Each card has 3 diferent sprites, the reverse with a z value of 0.01f, the main image of the card with a z of 0, and a transparent sprite with a z of -0.01f.
    All the sprites are in the same sorting layer and all has the same order in that layer.

    When I rotate around the X or Y axis to flip the card there is not a 3d rotation effectin the transparent layer, it appear and disappeat at some angle...

    Here's an image to explaint it better:
    $vh80nm.jpg

    As you can see, when I rotate the card a little bit, the bushes disappear behind the ground
     
  2. JesusMartinPeregrina

    JesusMartinPeregrina

    Joined:
    Nov 2, 2013
    Posts:
    44
    Still without a solution... please?
     
  3. Gnejs

    Gnejs

    Joined:
    Jun 24, 2015
    Posts:
    7
    Hey, really old post but I am having pretty much the same problem, did you find a solution or another approach?

    Thanks.
     
  4. blizzy

    blizzy

    Joined:
    Apr 27, 2014
    Posts:
    775
    You could try using the same Z location for each part, but using "order in layer" instead to sort them correctly. Then rotate only half (to where everything is visible from the edge, and thus becomes invisible.) At that point, reverse the "order in layer" for all parts, and then continue rotating.
     
  5. Gnejs

    Gnejs

    Joined:
    Jun 24, 2015
    Posts:
    7
    Hey Blizzy, I was able to work it out with sorting layers, thanks :)