- Home /
GameObjects and UI
Hello!
Is it possible to have gameobjects visible in the UI? I added rotating gameobjects to the ui but can't see them in play mode. When I switch to scene view while in play mode I can see them but the camera doesn't see them.
I have the gameobjects inside the canvas in the hierarchy and they are on the UI Layer.
Thanks in advance!
Answer by Tonks · May 18, 2015 at 05:11 PM
There are several things at play here, I notice that you have added it under the canvas hierarchy (which isn't actually necessary, as it isn't a UI element and wont need to access the UnityEngine.UI library) and you have ensured it is on the correct layer. The only thing I can really think of being a problem is the location of the gameobject in your scene, is it actually within your UI Camera's view frustum? The far clipping plane may be close (as most UI is effectively 2d) whilst your gameobject may be sitting just outside of that range. It may sound silly, but check your near clipping plane as well.
Also, be aware that you may need to switch your UI Camera's rendering space to world space, rather than screen space, though this really should not be an issue.
First image is game mode and second image is scene view.
Your answer
Follow this Question
Related Questions
How do i get the child of an GameObject the pointer is hovering over? 0 Answers
HUD reticle question 0 Answers
[c#] first script isnt disabling canvas and player cant move (issue with first script) 0 Answers
Unity ads , can't we show video by clicking a button? 1 Answer
[c#] first script isnt disabling canvas and player cant move (issue with first script) 1 Answer