3d Object in GUI Layer

Is it possible to put a 3D Object on the GUI Layer?

I made a life bar out of 3D heart shapes. I scripted them and added them as a GameObject. Then I parented the heart GameObjects to the mainCamera. It works fine but there are some flaws with this approach. I have to manually position the hearts for each scene.

Is it possible to put the heart GameObjects on the GUI Layer instead? It would be a simpler approach.

I’d render them with a second camera. Give it a limited viewport and disable any kind of screen clearing. It’ll just draw the hearts over the top of whatever you have on your screen.

You have a couple of options:

  1. If you have Pro, you can use a rendertexture.
  2. If you don’t have Pro, you can put the hearts in another layer that is blocked on the main camera, and then use a secondary camera to render the hearts. Take a look at the ‘normalized viewport’ and culling options of the camera class.

Let me know if this is unclear.