Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 ScriptGirl · Mar 18, 2012 at 09:14 PM · cameraguitexture

My GUI elements are not rendering on top of all cameras. Any ideas why?

I was under the impression that all GUI elements are supposed to render over the top of every camera in the scene. I've opened a new scene and added two cameras, both with a gui layer, and with the depths of 0 and 1 respectively. I have resized the second camera's viewport rect and then created a GUI Texture (Gameobject > Create other > GUI Texture) from a transparent png frame. I'm confused as to why my second, resized camera is rendering over the top of GUI Texture whose Z has been set to 10. Could someone please explain to me why this is happening, am I missing a specific setting or something? Is it possible to get my GUI texture to be on top of the second camera? Any help is appreciated :)

alt text

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

1 Reply

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

Answer by Bunny83 · Mar 19, 2012 at 03:19 AM

Another way is of course to use a third camera just for your GUITexture / GUIText stuff and remove the GUILayers from the other cameras.

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 ScriptGirl · Mar 19, 2012 at 06:18 AM 0
Share

Thanks for your input Bunny83. If I use a third camera though, won't it appear as a simple rectangle/square like my second (red) camera in the image above, loosing the GUITextures outer border?

avatar image Dakwamine · Mar 19, 2012 at 10:28 PM 0
Share

I suppose Bunny83 suggested you to set the Clear Flag of your third camera to "Depth Only" or "Don't Clear". You will be able to see through the frame transparency ins$$anonymous$$d having a background "Solid Color".

Although I would personnaly prefer the GUI method, the method described by Bunny83 works great too!

avatar image Bunny83 · Mar 20, 2012 at 04:21 AM 1
Share

Sure ;) I don't use GUITextures or GUIText components. Well the "new" GUI system isn't perfect, but it's very powerful if used the right way ;) I just wanted to add another solution. The GUILayer component on a camera will render all GUITextures and GUITexts after the camera itself has finished rendering it's view. Therefore the GUI stuff will always be on top of the cameras view, but keep in $$anonymous$$d the cameras are drawn independently from each other. The camera with the lowest Depth value will be rendered first, the highest value at last. Usually you don't need to resize the viewport unless you need the clipping in some way.

Just a third camera with a high depth value that is responsible for rendering all GUI elements. Set the "Clear Flags" to "Don't clear", use a seperate layer for the GUITextures and set the "Culling $$anonymous$$ask" to render just this layer. Remove the GUILayer components from the other cameras. Now all GUITextures are rendered on top of all other cameras.

avatar image ScriptGirl · Mar 20, 2012 at 07:11 AM 0
Share

Brilliant idea! Just tried it out and it is exactly what I was looking for. I never would've thought of that. Really creative & really helpful answer!! Thank you

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Apply Render Texture To GUI + Transparency? 2 Answers

GUI Texture not visible 3 Answers

Texture Size doesn't match collider size 0 Answers

Trying to make a Diablo like minimap, but I am having problems. Bug? 0 Answers

Path Trigger Animation 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