Drawing 3D Objects over GUI

Hi,

I’m trying to draw a 3D object in front of the GUI system I’ve made, it always goes under it though. Is there a way of handling this?
All the GUI is being drawn using the OnGUI function and I’m having a bad time.

Thanks guys.

Have you tried using Layers? → To the documentation!

Layers won’t do anything. OnGUI elements are always drawn on top of the world.

That’s correct. So there’s literally no way around having a 3d object in front? Or am I doomed?

Yup, after digging around, you’re right. :frowning:

Not when using OnGUI.

Wouldn’t say that, you could use a RenderTexture, however this requires Unity Pro… If you do have Pro you should have no problem duplicating whatever effects you want with that.

You could also simulate a gui by using planes and scaling them to the aspect ratio and effectively make your own GUI system… but that’s a fair amount of effort all in all to get it looking right on all different resolutions and having it fit the corners of the screen properly.

Perhaps you could look to attach a camera to the 3D object, and make the camera render it’s view as a texture, then draw that texture in your GUI.

Thats what I was thinking too. Something like a renderTexture. (pro feature)

(off topic) - Why devs place there PC stats on there signature?

Is that just a bragging thing lol? What does the 1600x900 mean? Is that your screen res/size?