Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
11 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
0
Question by wvickery · Jul 11, 2015 at 04:55 PM · uicanvasissuesorting orderrender order

What sets Canvas.renderOrder and why would it not respect the sorting order?

I have a very strange issue in my game at the moment. I have multiple canvases all using the 'screen space - overlay' render mode, and their sorting orders aren't being respected with out any good reason.

There are 4 Canvas's in the scene. They all have unique sorting orders. One is set to 0. the others are set to a higher value. Around 20-22.

What I am doing is that in game I am instancing these other canvas as a part of view system that pops up screens in our game. The crazy thing is that sometimes the in game ui, which has a sorting order of 0, sometimes shows above the others which have a higher sorting order. When we remove a couple of the canvas' then things stabilize and respect the sorting order. I am really not sure what is going on.

After looking at this all afternoon, and doing digging we found out that the canvases also have a .renderOrder value which isn't exposes to us. It seems to be the internal variable uses at run time to actual determine the final render order for each individual thing. This seems like a very valid and reasonable thing to exist, but it isn't respecting the sorting order due to unknown reasons.

I have a attached an image showing some debug logs where I pop open the new canvases 3 times. (I create and then delete them 3 times). They show at the time the canvases are created what the .renderOrder, .sortingOrder (we set), .overrideSorting variables. It shows how sometimes the values make sense and sometimes they don't at all.

alt text

The order of the debug groupings is as follows

  • Main Canvas for the instance group (instanced)

  • In game UI (already exists in scene)

  • Secondary for view group (instanced with first)

  • Tertiary for view group (instanced with first)

It would be very helpful to get some more insight to what determines the .renderOrder value is for a canvas in the game and possibly how multiple canvases may break the system. Thanks!

screen-shot-2015-07-10-at-105417-am.png (132.8 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

2 People are following this question.

avatar image avatar image

Related Questions

Canvas override sorting issue. 1 Answer

4.6 UI sort order in fornt of IMGUI/OnGUI possible? 2 Answers

How to change UI image render order dynamically on runtime 1 Answer

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

Move a UI element with respect to canvas scaler 0 Answers


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