Search Unity

[OFFICIAL] 2D Sorting feedback

Discussion in '2D' started by pvloon, Dec 29, 2015.

  1. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,716
    Honestly I wouldn't expect anything soon. Best to just use the above method as your default way and forget about it. Otherwise you may be waiting a really long time. Some issues seem to fall under the rug for years.
     
    IJhunter likes this.
  2. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    229
    I am sure that I've seen some kind of update on this recently, either here in the 2D forum or in the Experimental Preview forum. Someone from Unity said that they're working on a way of allowing the user to choose between pivot or sprite center-based sorting. I can't seem to find that post now. (I think that it was buried in a post about something else.) Maybe @rustum can update us?
     
  3. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,558
    IJhunter and AssembledVS like this.
  4. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    573
    Has anyone figured out what the new Sort by Pivot Point feature does? I've been playing around with it but I can't get it to do anything:

    • I laid out two of the same sprites at the exact same position with the same sorting layer and order in layer.
    • It's got its pivot set to the bottom. One has sprite sort point center, the other has sort point pivot
    • I gave one of them a tint to differentiate which one is which
    • I switched the sprite sort points around, expecting the order it's drawn to be changed, but nothing happened
     
  5. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,558
    @arvzg

    That's probably because the default sorting axis is using Z axis, so if the pivot and center points are both at the same Z, you won't observe a drawn order change.

    To do what I think you're trying to do, you would also need to set the Transparency Sort Axis to (0, 1, 0) to sort vertically.
     
    arvzg likes this.
  6. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    573
    I've worked with Unity for 5+ years and somehow never knew about transparency sort axis. Today I learned!
     
    jeffreyschoch likes this.
  7. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    229
  8. IJhunter

    IJhunter

    Joined:
    Feb 3, 2016
    Posts:
    7
  9. alifelove

    alifelove

    Joined:
    Jul 23, 2018
    Posts:
    1
    Last edited: Jul 23, 2018
  10. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,558
    That can be solved with SortingGroup component.
     
    Last edited: Feb 6, 2019
  11. Shadoninja

    Shadoninja

    Joined:
    Nov 12, 2013
    Posts:
    26
    For anyone grave digging like me, Unity supports sorting by pivot now. It is a setting on the sprite renderer:

     
    Lars-Steenhoff and CarterG81 like this.