2D Toolkit Forum

2D Toolkit => Support => Topic started by: aikitect on May 09, 2014, 05:10:36 pm

Title: Particle Systems Rendering Behind All tk2dSprites
Post by: aikitect on May 09, 2014, 05:10:36 pm
Hello, I have set up a scene where my camera is at z: -10, my tk2D sprites are at z: 0, and my particle system is at z: -5.  When I generate particle effects, my particles are definitely in front of the sprites in the scene view, but get rendered behind the sprites in the game view.  Why is this happening?  I am using an orthographic camera by the way.
Title: Re: Particle Systems Rendering Behind All tk2dSprites
Post by: unikronsoftware on May 11, 2014, 11:07:26 am
Check that the particle shader doesn't force drawing in front of the tk2d shader, and try pushing it even further forward. Its impossible to say why its drawing in front of the other without seeing the effect - unity uses the bounds of the particle system to work out sorting order. Eg. with the tk2d demo collection, and the default unity particle system, setting the particle system to z = 0.1 will push it behind the sprite, whilst a z of 0 or less will be in front.

Also make sure the sorting layers dont override anything.