Hello Guest

Author Topic: Draw order changing on perspective?  (Read 4471 times)

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Draw order changing on perspective?
« on: September 23, 2012, 07:17:07 pm »
Hello - I'm a new tk2D user, and wanted to start off by importing a character sprite made up of a few different parts. However, in both the game viewer and the scene viewer, depending on what angle I'm looking at my sprite, certain parts will appear in front of others, and vice a versa. I should note that this is not with just the camera, but with the general viewer as a whole. Placing pieces of the sprite slightly behind others does not seem to help, unless its way back and thus starts to look too 3D.

I've looked around and found similar problems, but no solutions that helped me, can anyone here help me out?

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Draw order changing on perspective?
« Reply #1 on: September 24, 2012, 08:11:15 am »
There is a way to fix this. What you need to do is write a small MonoBehaviour which attaches to the camera, and sets this parameter:
http://docs.unity3d.com/Documentation/ScriptReference/Camera-transparencySortMode.html

Camera.transparencySortMode = TransparencySortMode.Orthographic.

This won't fix the scene view, but the draw order in game view will be far more predictable.

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Draw order changing on perspective?
« Reply #2 on: September 25, 2012, 12:00:38 am »
thanks, I'll give it a try