Search Unity

Hierarchical Sorting

Discussion in 'Scripting' started by DigitalGrunt, Feb 25, 2014.

  1. DigitalGrunt

    DigitalGrunt

    Joined:
    Feb 25, 2014
    Posts:
    8
    I know there have been many discussions on how to control the sort order of objects and how Unity sorts objects automatically based on the distance from the camera however, I believe being able to override this behaviour at times would be beneficial.

    As it stands now the hierarchical view is sorted by name and has no influence on how the objects are drawn yet, being able to control the draw order manually from this view would be a great help. I've noticed that "Sorting Layers" have been added in version 4.3.1 - while this helps, it still makes it difficult to visualize the draw order as there's no direct way to list the object rendering with that layer. Are there any plans to extend the sorting layers to a more comprehensive visual approach in the near future? :confused:

    Thanks,:)
    -G.
     
  2. Lawros

    Lawros

    Joined:
    Feb 4, 2014
    Posts:
    11
    Why not use several different cameras to control how your objects are drawn? For example, you can have a background camera, foreground camera, HUD camera, etc. and if you want to see which objects are being drawn by which camera, you can simply toggle the camera game object on and off to show/hide the objects drawn by that camera. I might be misunderstanding your question, but does this help?
     
  3. DigitalGrunt

    DigitalGrunt

    Joined:
    Feb 25, 2014
    Posts:
    8
    My question was more related to alpha transparencies in 3D and controlling the draw order when drawing two or more semi-transparent objects where one can overlap another. I'd imagine using multiple cameras to achieve this would cause occlusion/stenciling issues.
     
  4. Free-Compass

    Free-Compass

    Joined:
    Jul 4, 2012
    Posts:
    12
    If setting the queue of renderer to 3000 or "transparent", you can control the draw order by using the unity 4.3 2D sorting system. For example, particle renderer, trail renderer, even mesh renderer.

    Sorting View :D
    I hope my plugin will help you to solve the problem. Thank you !