• 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
3
Question by zrice03 · Mar 24, 2018 at 04:15 AM · uigameobject

How to make a GameObject show as part of a UI

Hi, I'm making a space exploration game, and as part of it, I want to have a UI that shows planet info along with an image of the planet (which matches the texture of the planet in the scene). So far my solution is to have a sphere be a child of a canvas, with the sphere given the texture of the planet. I know that in order for the sphere to actually show up the canvas has to be in "Screen space - Camera" mode. However, that leaves it possible for other GameObjects in the scene to clip through the canvas, which looks really bad. In "Screen space - Overlay" mode, that doesn't happen, but of course the sphere isn't rendered. Is there a way to do both, where the canvas is always on top of the scene, but then have the sphere on top of that? I've seen references to multiple cameras and layers, but I don't really understand what they are saying, or if that would be a solution here.,Hi, I'm making a space exploration game, and part of the game is a canvas which shows planet information along with an image of the planet (which needs to look identical to the planet GameObjects in the scene). My solution so far is to have a sphere be a child on a canvas which is displayed as an overlay, with the sphere getting the planet's texture. Now, I know that in order for a GameObject to render along with UI, it has to be in "Screen Space - Camera" mode. However that leaves it possible for other GameObjects in to be able to clip through the UI, which looks really bad. Is it possible to have the UI completely lay on top of everything else in a scene (like in "Overlay" mode), but also have a specific GameObject "on top" of that? I've seen references to multiple cameras and layers, but I don't really understand what they are saying.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Harinezumi · Apr 05, 2018 at 08:03 AM

Use a separate camera for rendering UI only (set culling mask to only UI) and set its Depth higher than your main camera - that way it will draw over it even though it is Screen space. Then you set the Canvas to "Screen space - Camera" mode and set this camera as its camera. Finally, the main camera should not render the UI, so uncheck UI in its culling mask. Of course, your Canvas and all its children have to be on UI layer.

Another approach is to have a camera that looks at the planet draw to a render texture, and use that texture in an Image component. But this is less efficient, and less flexible.

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 MindGem · Aug 04, 2021 at 11:37 PM

Hi,

I have the same problem. My Instanciated things wont show up. But I must have my Canvas set to Screen Space - Overlay or my Color picker thing wont work...for some reason.

So what can I do to make things show up on my scene with Screen Space - Overlay set on the Canvas? If you answer, please be specific. I'm very new to Unity.

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 withoutdraw · Mar 02 at 01:31 AM 0
Share

https://www.youtube.com/watch?v=8yzpjkoE0YA

avatar image
0

Answer by Lilliana69 · Mar 02 at 06:19 AM

All UI must be placed inside a Canvas GameObject, or else the Camera won't render it. The easiest way to add a Canvas is by adding a UI GameObject through the GameObject > UI dropdown menu. This will automatically add it to the scene along with the EventSystem GameObject, which is needed to handle interactivity

Dunkinrunsonyou

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

161 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 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

How to make UI(Gameobject) appear on collision enter? 0 Answers

On Button Click Enable - Disable GameObject Through Inspector 1 Answer

Unity UI : Attached Gameobjetcs resets when starting the game 1 Answer

UI Selection in GameObject dropdown out of place? 1 Answer

instantiate gameobjects inside a canvas 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