2D Toolkit Forum

2D Toolkit => Support => Topic started by: zeitweise on October 11, 2013, 11:46:53 pm

Title: tk2dCamera: Sort mode Orthographic reverts to Default
Post by: zeitweise on October 11, 2013, 11:46:53 pm
Hello,

I don't see what I am missing here: I upgraded to tk2d 2.20 final + hotfix

Now my z-ordering is broken. I figured out that using these options works: Projection: "Perspective", Sort mode: "Orthographic".
My problem: Always when I enter play mode (or when I make a build) the camera’s sort mode reverts back to "Default".

Best regards
@zeitweise


Title: Re: tk2dCamera: Sort mode Orthographic reverts to Default
Post by: unikronsoftware on October 12, 2013, 10:09:45 pm
Hi,

This was an issue - I believe it should be fixed in 2D Toolkit 2.2.2 - please let me know if its still broken there and I'll investigate this further.
Title: Re: tk2dCamera: Sort mode Orthographic reverts to Default
Post by: zeitweise on October 13, 2013, 05:30:39 pm
Hello,

thanks for the reply. I’ve updated to 2.2.2. now but unfortunately it is still broken. It does not matter if I use my old project or setup a new one.

Best regards
@zeitweise

Title: Re: tk2dCamera: Sort mode Orthographic reverts to Default
Post by: unikronsoftware on October 14, 2013, 01:18:01 pm
Ok. I've investigated this - I will add a better fix to the next version, but for now I suggest setting it in the tk2dCamera.Start function, or your own script (you don't need tk2dCamera for a perspective camera anyway).

The older behaviour in 2.0 was leaking memory - the transparencysortmode function shouldn't be called every frame as it allocates memory. Turns out that value isn't saved in Unity, which makes the current fix not work as it should.
Title: Re: tk2dCamera: Sort mode Orthographic reverts to Default
Post by: zeitweise on October 14, 2013, 05:24:20 pm
Thanks.

I manually added

   void Start() {
      camera.transparencySortMode = TransparencySortMode.Orthographic;
   }

to tk2dCamera.cs

and that seems to work.

I am looking forward to an update but this will work for now.

Best regards
@zeitweise