Hey guys kinda stumped here i have a fx prefab instantiate before object is destroyed and its working great my only problem is is instantiating behind background etc first 2D game so some insight would be great.
Not quite sure what you mean by fx prefab, but I assume you mean a particle system.
In that case make sure the particle renderer is using the right sorting layer and has a higher order than your other sprites.
Sorry about that lol was referencing to the variable i labeled but yea its basically the particle system, cool thanks i have a look at that
ok forgive my slowness but im using fx mega Pack asset and when importing ptrfab i cant find where to change sorting layer
Sorting layers only apply to sprites. You can just change the Z position to something more positive if you want it in front or something negative if you want it behind.
Actually, sorting layers apply to all renderers now. However, only for sprites you can see them in the editor. But you can always change them in code, like:
particleSystem.renderer.sortingLayerName = “Foreground”;
See this for more details:
http://answers.unity3d.com/questions/577288/particle-system-rendering-behind-sprites.html
They might want to update their documentation:
+1
You should submit a bug report if you find the documentation misleading.
tried this still a no go the im using cartoon FX pack 1 and no matter what i do it always instantiates behind everything.
Did some tinkering and indeed setting the sorting layer thru code did the trick thanks Stilghar