Search Unity

non-sprite GameObjects in 2d games

Discussion in 'Editor & General Support' started by peterworth, Mar 4, 2014.

  1. peterworth

    peterworth

    Joined:
    Mar 4, 2014
    Posts:
    7
    I'm using a lot of particle effects and text mesh objects in my 2d game, and laying them out in the editor is incredibly awkward, because they will always appear behind any sprites in the scene (one of which is the BG image and covers the whole scene).

    I'm able to bring them to the correct layer in-game with a script like this on each of them:

    Code (csharp):
    1. var sortingLayerName : String;
    2. var sortingOrder : int;
    3.  
    4. function Start () {
    5.     var someRenderer : Renderer = this.renderer;
    6.     someRenderer.sortingLayerName = sortingLayerName;
    7.     someRenderer.sortingOrder = sortingOrder;
    8. }
    but this doesn't affect what i can see in the editor.

    Are there any workarounds for this? Or is it something that needs to be fixed in unity? (quite urgently in my opinion!)

    Thanks for any help.