I am making an inventory and armor system and I want to create a background for the inventory system, I also want a 3D view of the character contained within the inventory panel,
To do that I would need to make my 3D model infront of the GUI background and I have no idea how to make this possible, seeing as the OnGUI function always renders at the front how would I do this.
I tried using a GUITexture which I was able to get behind my object but each time I save a reload unity it is pushed to the front of the scene again infront of the 3D model of my character.
thanks for your time and any suggestions you can give Scribe
P.S. yes the model does have to be 3D if it is possible as I want to allow rotating it to see different angles
asked Aug 20, 2011 at 03:10 PM
If I'm not mistaken, you'd use a separate camera for that GUI-3d object, and set it's Depth closer than anything else, so it renders last.
answered Aug 20, 2011 at 04:29 PM
Can anyone explain this in a little greater detail? For my situation:
I have a script using a semi-transparent black GUILayout.Box to display a wall of text. What I would like is a 3D model (the default unity Constructor for example), doing an idle animation in front of that GUILayout.Box, instead of being covered by the box.
I have a main camera, and a Constructor-only camera. I've added a new layer named "Constructor", and set the 3D Constructor model to that layer. The main camera culling mask is set for all layers EXCEPT "Constructor", and the second camera's culling mask will ONLY render the Constructor layer.
What do I do from here, to get the model to appear on top of the GUI box of text, instead of behind it?
I'm not sure about default GUI boxes but I got the GUI health texture behind my boxer by having 3 cameras. The main camera doesn't use the layer the crowd plane is on or the texture. I then had the GUI texture on it's own layer. the main camera would show everything else, then you'd have to play with the depth settings on each camera. The main camera's depth would be the closest.Still ironing out the code before I start to finalize the graphics. Been a real pain but we've been closing in on it now.