2D Toolkit Forum

2D Toolkit => Support => Topic started by: spinner on September 28, 2013, 09:38:26 pm

Title: Z Depth problem when using perspective camera.
Post by: spinner 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,
Title: Re: Z Depth problem when using perspective camera.
Post by: spinner on September 28, 2013, 09:51:02 pm
hm, it seems that
camera.transparencySortMode = TransparencySortMode.Orthographic

did the trick.

Thanks.