Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Jiven · May 04, 2016 at 03:58 PM · canvaszoomsortingsorting layerssorting order

Is there a way to adjust canvas z-ordering while using Alphabetical Sort in the Hierarchy?

I'm fairly new to using the Canvas. I do like the readability/consistency that Alphabetical Sorting gives but when I need to manually adjust sprite z-order of Canvas objects I'm not able to. Clearly it would be silly to allow resorting while in Alphabetical since it would break the rule.

Is there some other way (in the editor/inspector) to adjust Canvas sorting aside from the hierarchy that I'm overlooking?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FortisVenaliter · May 04, 2016 at 05:07 PM 0
Share

Not that I'm aware of, but the Hierarchy view does have a search function that may be useful...?

avatar image Jiven FortisVenaliter · May 04, 2016 at 07:58 PM 0
Share

I'm not really looking to search the hierarchy though. Looking for some way to manipulate Canvas objects (which use hierarchy transform order to imply zorder/layering) But when in Alphabetical Sort mode, you're unable to move hierarchy objects around for obvious reasons.

avatar image FortisVenaliter Jiven · May 04, 2016 at 08:00 PM 0
Share

Right, I generally don't use alphabetic for that reason, I just organize my hierarchy into empty gameobject containers, so it's all sorted. $$anonymous$$aybe if you explain the reason you need to use alphabetic, we can suggest a workaround?

2 Replies

· Add your reply
  • Sort: 
avatar image
10
Best Answer

Answer by brunocoimbra · May 04, 2016 at 08:06 PM

Just click with the right mouse button on the object's Rect Transform that you want to adjust the order and there will be the options "Move to Back" and "Move to Front".

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jiven · May 04, 2016 at 08:13 PM 0
Share

Beautiful. I hadn't seen that right click option before. You'd think they'd add that to the right click menu when right-clicking in the hierarchy too.

Thanks!

avatar image ThibaultUrien · Nov 05, 2018 at 02:36 PM 0
Share

Does it really do what you want if the parent rect transform have a GridLayout or other kind or order dependant layout?

avatar image PaulOllivier · Dec 13, 2018 at 11:42 AM 0
Share

Wow thanks, I was looking for this option for ages!

I wonder why it's hidden like that, almost as hard to find as an easter egg...? It's such an important feature!

avatar image IARI · Nov 27, 2020 at 02:34 PM 0
Share

That doesn't seem to work at all in a way that is independent from the order in the hierarchy - that was requested in the question. When i click "move to front" it actually moves the object inside the hierarchy.

avatar image
1

Answer by coolraiman · May 04, 2016 at 08:12 PM

you should avoid the Alphabetical Sorting

if you order and name your stuff well, your hierarchy will be even more cleaner.

also think of canvas as some sort of html. a child will be over its parent. Group your canvas element into well named empty parent. parent dont have to be empty, you can give them image for backgrounds since they will always be drawn behind its child

Then if you want an object to be drawn over an other and they are sibling you can just play with the sibling index

example:

 Transform object1;
 Transform object2;
     
 object2.SetSiblingIndex(object1.GetSiblingIndex());

now object 1 will be drawn over object2 Also a child is always drawn over his parents.

for sibling, the first element is in the bottom and the last sibling is on top.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jiven · May 04, 2016 at 10:51 PM 0
Share

Yea, I do like the consistency of alphabetical, but properly/well organized hierarchies are great. Sometimes hard to enforce though across many $$anonymous$$ms/projects.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

45 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Allow for sorting between different sorting layers 0 Answers

UI masking on nested canvas with overwrite sorting layer. 1 Answer

Is there a way to sort UI elements overriding the hierarchy? 0 Answers

UI object drawing order is different between Unity Editor and Standalone version 1 Answer

Complicated Question about Arrays and Duplicate Sorting Orders! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges