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
2
Question by DarkSlash · Jan 09, 2012 at 03:34 PM · cameraguigameobjectcameras

2 cameras: 1 for GUI and 1 for GameObjects

Im using GUI to render some texture, buttons, text, etc. I need a GameObject to appear ON TOP of that things. With Unity usual behavior first render the GameObject and then, on top, the GUI (I need exactly the opposite).

Some people told me to create 2 cameras. One for the GUI and one for the GameObject. The exact words where :

just imagine 2 cameras next to each other, one is looking at box A at position x=0, y=0, z=0. The other is looking at box B at position x100 y100 z100. If the first camera is set to depth 1 and the second is set to depth 0 and the first camera is set to depth only, When you hit play, you will see both boxes in the scree. 2 images are rendered by placed on top of each other like paper.

I follow that instructions but nothing happens. Is that tip correct? Is that the way to do it? What Im missing?

**EDIT: I Found this and works PERFECTLY! http://www.41post.com/3255/programming/unity3d-creating-a-gui-with-both-3d-and-2d-elements**

Comment
Add comment · Show 1
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 jahroy · Jan 09, 2012 at 04:02 PM 0
Share

I'm pretty sure the GUI will always be drawn on top of everything else.

As far as I understand, that's the way it works.

4 Replies

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

Answer by DarkSlash · Jan 09, 2012 at 05:24 PM

I found this and works PERFECTLY! :)

http://www.41post.com/3255/programming/unity3d-creating-a-gui-with-both-3d-and-2d-elements

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 Ye-Xuan She · Oct 11, 2013 at 02:38 AM 0
Share

Very useful thanks!!

avatar image
-1

Answer by Eric5h5 · Jan 09, 2012 at 04:45 PM

OnGUI code renders on top of everything and can't be changed. GUIElements (GUIText/GUITexture), however, can be layered with separate cameras.

Comment
Add comment · Show 2 · 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 komodor · Feb 11, 2014 at 04:05 PM 0
Share

he obvously didn't ment oldschool native gui

avatar image Eric5h5 · Feb 12, 2014 at 04:55 AM 0
Share

@komodor: what are you talking about? The question didn't specify whether he was using OnGUI code or GUIText/GUITexture objects.

avatar image
0

Answer by Hybris · Jan 09, 2012 at 06:06 PM

Couldnt you just use 2 cameras 1 with only render gui and the other with only render gameobjects or something like that?

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 Empus · Feb 23, 2018 at 06:39 PM

You can use WorldSpace render mode of a canvas.

Simply put your UI behind your model. Et voila!

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

10 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

Related Questions

GUI controlling other game objects 0 Answers

Camera Switching or Scene Changes? 3 Answers

"Press [e] to open" on stationary object when onTrigger 0 Answers

Render GameObjects over GUI.Layer 1 Answer

GUI Window on GameObject location? 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