Search Unity

Particles appearing behind all sprites and background [SOLVED]

Discussion in 'Editor & General Support' started by Hi_ImTemmy, Nov 26, 2018.

  1. Hi_ImTemmy

    Hi_ImTemmy

    Joined:
    Jul 8, 2015
    Posts:
    174
    UPDATE: Turns out it was because the default shape for the particle system was a 3D cone / sphere. Changing it to circle fixed it.

    Hello,

    I'm trying to add a particle to my 2D scene however it's always appearing behind all my sprites and background art regardless of how I set the 'order in layer'.

    Here's the setup;

    The background is on the default layer at order 0:




    The particle is setup in it's Renderer to be at order 2:


    The end result is still the particle behind the background:




    Any clues?
     
    Last edited: Nov 27, 2018
    Sibasis2000 likes this.
  2. Hi_ImTemmy

    Hi_ImTemmy

    Joined:
    Jul 8, 2015
    Posts:
    174
    Before, the background and particle system shared the exact same Z value (0). If I give the particle system a different Z value then even more odd things start to happen:

     
  3. LelouchTheDemon

    LelouchTheDemon

    Joined:
    Jun 7, 2021
    Posts:
    2
    bump cause i had same problem and your thread helped me :)
     
  4. anamaux

    anamaux

    Joined:
    Mar 6, 2015
    Posts:
    20
    Hello, for anyone looking at this in 2021, go to the Renderer tab/section, and change the Order in Layer value to a higher number then your Sprites order. To test it out just make it the largest number possible and you should see it.
     
  5. happybullfrog57

    happybullfrog57

    Joined:
    Jan 13, 2022
    Posts:
    1
    upload_2022-7-29_12-11-35.png
    Still seems to appear behind the buttons no matter how high I set it
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Three (3) ways that Unity draws / stacks / sorts / layers / overlays stuff:

    https://forum.unity.com/threads/orthographic-camera-rendering-order.1114078/#post-7167037

    In short,

    1. The default 3D Renderers draw stuff according to Z depth - distance from camera.

    2. SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties

    3. UI Canvas Renderers draw in linear transform sequence, like a stack of papers

    If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:

    - identify what you are using
    - search online for the combination of things you are doing and how to to achieve what you want.

    There may be more than one solution to try.

    Additional reading in the official docs:

    https://docs.unity3d.com/Manual/2DSorting.html

    And SortingGroups can also be extremely helpful in certain circumstances:

    https://docs.unity3d.com/Manual/class-SortingGroup.html
     
  7. Sibasis2000

    Sibasis2000

    Joined:
    Feb 25, 2023
    Posts:
    2
    Thank you Your Update helped me.