Hello Guest

Author Topic: Z Depth problem when using perspective camera.  (Read 3868 times)

spinner

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Z Depth problem when using perspective camera.
« on: September 28, 2013, 09:38:26 pm »
Hello,
I'm working on a top down game and I have a bunch of sprites that represent the ground and the 2d chars that are  over the ground, especifically 2 units in Z axis.

Depending on the way the camera moves, sometimes the ground sprite is rendered over the 2d chars, as if the ground has a higher z value than the characters, but that's not the case.
If I use orthografic camera it works fine, but I want to use perspective to work with other effetcs.

Is there any trick that I can use to avoid this behaviour?

Best regards,

spinner

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Z Depth problem when using perspective camera.
« Reply #1 on: September 28, 2013, 09:51:02 pm »
hm, it seems that
camera.transparencySortMode = TransparencySortMode.Orthographic

did the trick.

Thanks.