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
5
Question by staff0rd · Nov 19, 2014 at 05:27 PM · ui4.6

Gameobjects added to Canvas do not show in Game

I've got the following Hierarchy;

  • Canvas

    • Panel

      • Cube

The Cube is visible in the Scene on top of the Panel, however it is not visible in the Game.

How can I get my non-UI GameObjects to display inside a Panel?

Comment
Add comment · Show 2
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 jcampos · Mar 03, 2015 at 09:05 AM 0
Share

I'm having a similar issue...

I have a prefab that has a Canvas inside (to hold the health bar of the unit, for example).

When I Instantiate the a new object from that prefab (In run time), the Image don't show up.

I'm setting the camera after Instantiating the prefab as...

 canvas.worldCamera = Camera.main;

But when I add the Prefab to the scene and run the game, the Image does show up (Using the same script that attaches the camera).

What should I do to load a canvas on the fly? Is it even possible to do that?

avatar image Omnedeus · Jun 06, 2016 at 01:38 PM 0
Share

@vtunity

Is there a workaround? Because I noticed google cardboard doesn't work anymore, (buttons at bottom are invisible, and my score counter doesn't exist anymore!

4 Replies

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

Answer by CanisLupus · Nov 22, 2014 at 02:30 PM

I needed to know more about your setup, but it looks like a problem with layers and/or cameras. The Game view relies on camera settings to display objects. If an object is in a layer that no camera sees, it will not appear.

By default, Canvas comes configured in "Screen Space - Overlay", in which it uses no Camera and will only show uGUI elements. If your Cube is the default Unity cube, it uses a MeshRenderer, and it won't be visible inside an "Overlayed" Canvas, even if it is in the same layer as the Canvas. It's only visible using some camera in the Canvas.

Two options:

1: Change the Canvas mode to either of the other modes (which use a camera). Then create a camera that sees the UI layer and change your Cube's layer to "UI". Drag the camera to the Canvas. As long as the camera position is adequate, you should see the cube.

2: Leave the Canvas in Overlay mode and just create a new camera that sees the layer your Cube is in (I'm guessing it is in the "Default" layer). This will work, but might not be what you want, as you'll have a Canvas that sees uGUI elements only, and a camera that only sees the cube.

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 staff0rd · Nov 25, 2014 at 07:01 AM 0
Share

I went with option one, thanks so much.

avatar image Wouter-Morren · Jan 08, 2017 at 09:34 AM 0
Share

Thank you @CanisLupus! The tip of changing the Canvas mode to something different than Overlay helped me solve the same problem. Only by just changing the Plane Value to one that was big enough I was able to make the GameObject visible in the Game$$anonymous$$ode again. Thanks again!

avatar image CanisLupus Wouter-Morren · Jan 08, 2017 at 11:17 AM 0
Share

You're welcome! ;) Yes, depending on the camera near and far planes, the plane distance value can also be important. For UI I tend to set near to -1000, far to 1000 and then set the plane distance to 0, but it's just personal preference.

avatar image
3

Answer by vtunity · May 28, 2016 at 01:19 PM

@staff0rd Starting with 5.3.4p2, a bug in Unity prevents rendering World Space uGUI Canvases into a RenderTexture. Since RenderTextures are used for distortion correction, this effects all such canvases in VR.

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 Zacrotus · Jun 20, 2016 at 07:14 PM 0
Share

Seems to still be the case in 5.3.5f1. :( Does anyone know when a patch will be release to address this issue?

avatar image LtKelleyUSMC · Nov 04, 2017 at 01:22 AM 0
Share

Just like those damn $$anonymous$$icrosoft updates in Windows 10, these things have not fully been TESTED, so why are we working in software that has not been fully tested. SI$$anonymous$$PLE ANSWER:Work out the bugs in these RELEASES, before they are released to the PUBLIC... (not rocket science)

avatar image
1

Answer by gaaraofdesert9 · Oct 23, 2020 at 07:34 AM

This hurts to admit since I've been stuck with this problem for the last couple of days, but check the Alpha on your instantiated game objects' prefab....... I just found this out, and it hurt my brain.... I am dumb sometimes, but if this can help anyone else, I would rather share my pain. XD

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 gboudrias · Dec 29, 2021 at 12:02 AM

I had this issue with sprites in LTS 2020. If anyone else has this issue, check the scale of the resulting objects, at too small they simply won't be rendered (this seems related to the way scaling works and not necessarily absolute size).

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

11 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

Related Questions

Showing text on top of a Slider, but not blocking Handler? 1 Answer

Android screen is small? 0 Answers

4.6 Button OnClick Super Sensitive to pointer movement. 1 Answer

Unity 4.6 - Detect Touch On Screen 1 Answer

Text Color Null Ref 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