Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 brlan10 · Dec 15, 2016 at 01:27 AM · uiui imageuifont

CanvasRenderer text is behind sprites

In my 2D game, my UI text is rendering behind both UI and non-UI graphics. I cannot change the sorting layer because "CanvasRenderer" dose not have a sortinglayer option. What do I do?

edit: some clarification - I can change Z position and hierarchy order til I'm blue in the face, but anything above default sorting layer will render in front of the text. The text is behaving like a sprite that is on the default layer.

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

4 Replies

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

Answer by brlan10 · Dec 15, 2016 at 02:25 AM

I was using a "text" component, but I see that there are other text components available that don't use the very frustrating CanvasRenderer. I'm going to switch to using a Text Mesh.

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 seth_slax · Dec 15, 2016 at 02:49 AM 0
Share

Glad you found a solution, however I'd advise against using Text$$anonymous$$esh. It's notorious for having very bad performance.

Ins$$anonymous$$d, I'd recommend watching the official tutorials for the newest UI system. Once you figure out how it all works, it's incredibly powerful and can do a lot of really cool things.

https://unity3d.com/learn/tutorials/topics/user-interface-ui

avatar image
4

Answer by seth_slax · Dec 15, 2016 at 01:52 AM

Non world-space UI elements are drawn in order of hierarchy, so anything lower in the hierarchy will be rendered on top. World space renders things based on Z positions.

For the sorting layer, in a standard canvas GameObject (GameObject>UI>Canvas), in the Canvas component, if set to World Space you can specify a layer.

Also, if you're using a Screen Space - Camera canvas, lessen the Plane Distance so it's closer to the camera, then it should render it over any non-UI graphics.

Comment
Add comment · Show 3 · 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 brlan10 · Dec 15, 2016 at 02:17 AM 1
Share

I can change Z position and hierarchy order til I'm blue in the face, but anything above default sorting layer will render in front of the text. The text is behaving like a sprite that is on the default layer.

$$anonymous$$y layers are set up like [background > default > midground]

The text is rendering above background, and below midground. Very strange to me that it would behave on a sorting layer when you cannot modify its sortinglayer.

avatar image seth_slax brlan10 · Dec 15, 2016 at 12:04 PM 0
Share

Are you using the Canvas object (GameObject>UI>Canvas), or just an object with a CanvasRenderer component? You'll have much better results if your UI elements are children of a proper Canvas object.

avatar image DranrebKing · Aug 22, 2018 at 04:29 PM 0
Share

Thanks!!! This worked for me!

avatar image
2

Answer by Neonzone · Jan 04, 2018 at 11:11 AM

alt text


bildschirmfoto-2018-01-04-um-121032.png (12.9 kB)
Comment
Add comment · 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
0

Answer by coolamigo · Jul 19, 2021 at 06:12 AM

Keeping the parent an empty object worked for me some how

Comment
Add comment · 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

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

92 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 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 avatar image avatar image

Related Questions

UI - clamp the movement of a panel 0 Answers

Difficulties with world space canvas interaction 1 Answer

Instantiated UI objects with image components not appearing, rest of object works fine. 0 Answers

Getting the overlapping pixels between a UI mask and a UI image 0 Answers

UI button are sliced after exporting 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