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 FDNYRES1CUE · Dec 23, 2011 at 07:28 PM · cameraguidepth

Camera Viewport issue: Being Drawn Behined GUI

Hi,

I am coding a project right now that requires a view port within another cameras view port. As I have been doing this I have been setting the camera which is being drawn over the much larger camera's view-port to a higher depth. My issue is when The camera is being drawn the much larger camera's GUI is being drawn over the smaller one's Rectangle on the screen. The smaller view-port on the screen that I am trying to make to be at the front does not have a GUI Layer component attached to it. If anyone could help with this problem it would be greatly apreciated.

Thank you and have safe and fun holidays,

Jacob

alt text

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 FLASHDENMARK · Dec 23, 2011 at 07:28 PM 0
Share

Why did you format your question as code?

avatar image FDNYRES1CUE · Dec 23, 2011 at 08:30 PM 0
Share

Sorry, I must of clicked the wrong thing when I was putting in the image.

avatar image FLASHDENMARK · Dec 23, 2011 at 08:34 PM 0
Share

It's okay :)

1 Reply

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

Answer by jahroy · Dec 23, 2011 at 08:33 PM

The GUI will always be drawn over everything else.

If you don't want your GUI to be drawn over your smaller viewport, you need to draw the GUI elements and the viewport in different locations.

Your script must know where the small viewport is. You need to lay out your GUI controls so they're not in that rectangle.

You can get the pixel coordinates used by a camera's viewport by using Camera.pixelRect.

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 FDNYRES1CUE · Dec 23, 2011 at 08:44 PM 0
Share

ok, So maybe just thinking, the only GUI. Box that will be staying is the Largest one around the whole thing. That will be used to create the background in the " In Game PC application " (its being replaced with an opaque texture at some point). But maybe Ins$$anonymous$$d of doing that I could use the monitors background material as the UI's Background. Then the camera shouldn't have any problems right?

avatar image jahroy · Dec 23, 2011 at 08:54 PM 0
Share

Check out Camera.clearFlags (I think that's what you're after):

http://unity3d.com/support/documentation/ScriptReference/Camera-clearFlags.html

(you can also tweak the clear settings in the Inspector)

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

6 People are following this question.

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

Related Questions

Rendering a camera in front of a gui element 3 Answers

FLYING from Camera Position A to B per Buttom click? 5 Answers

GUI Window on GameObject location? 1 Answer

Displaying a gameobject over gui issues 0 Answers

Is there a way to change the order of the "Layers" Tab? 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