Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Unity 4.3 Particles and Sorting Layers (??)

Discussion in 'Editor & General Support' started by Pix10, Nov 16, 2013.

  1. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    I've googled, I've looked through the docs, but I'm missing how to get particles to render with sprites in 4.3.

    Release Notes:

    Not in Shuriken Renderers they haven't, there's just the usual age-based particle sorting ... what am I missing? :confused:
     
    Last edited: Nov 16, 2013
  2. smallbit

    smallbit

    Joined:
    Oct 3, 2013
    Posts:
    60
    The particle system doesn't have sorting layer fields in the inspector, however you can access them via script (look at demo scene)

    You basically put this into script :

    Code (csharp):
    1. public class ParticleSortingLayer : MonoBehaviour {
    2.    
    3.     void Start ()
    4.     {
    5.         // Set the sorting layer of the particle system.
    6.         particleSystem.renderer.sortingLayerName = "foreground";
    7.         particleSystem.renderer.sortingOrder = 2;
    8.     }
    9. }
    It works for
     
  3. YJack

    YJack

    Joined:
    Apr 7, 2010
    Posts:
    44
  4. andrewow

    andrewow

    Joined:
    Dec 2, 2013
    Posts:
    13
    YJack likes this.
  5. Free-Compass

    Free-Compass

    Joined:
    Jul 4, 2012
    Posts:
    12
    Sorting View :D

    I hope my plugin will help you to solve the problem. Thank you !
     
    Last edited: Apr 11, 2014
  6. NikaSeed

    NikaSeed

    Joined:
    Sep 7, 2014
    Posts:
    5
     
  7. davidjohn123

    davidjohn123

    Joined:
    Jan 8, 2016
    Posts:
    3
    Add this script to particle system and set a new sorting layer
    using UnityEngine;
    using System.Collections;

    public class SortingLayerOrder : MonoBehaviour {
    public int sortingOrder;
    public string sortingLayerName;

    // Use this for initialization
    void Start () {
    GetComponent<ParticleSystem> ().GetComponent<Renderer> ().sortingLayerName = sortingLayerName;
    GetComponent<ParticleSystem> ().GetComponent<Renderer> ().sortingOrder = sortingOrder;

    }

    // Update is called once per frame

    }