0
\$\begingroup\$

I'll make a navigation menu in my game and had the good idee to this the enemies to start games or go to the gun store. The problem is when I look in game mode, the enemy named ZomBear in hierarchy and gun are away.

The ZomBear and the gun are 3D elements that I will show on a canvas named StartScreen in hierarchy. How Can I do that?

(Click on image to see full size)

Notes by the hierarchy:

  • Everything that begin whit Btn are button elements.
  • StartScreen, PlayButtons and LevelButtons is a panel
  • Gun and ZomBear are 3D elements form the Prefab folder.

Here you have also a screen from aside:

\$\endgroup\$
1
\$\begingroup\$

You should be able to modify the setting on your canvas to a more desirable render mode. The canvas provides three options: screen space overlay, screen space camera and world space.

From what I understand, you would want to use world space, as it allows you to place a canvas freely in the world without it automatically obscuring the rest of the scene.

\$\endgroup\$
  • \$\begingroup\$ I've change the options but the best one was screen space camera, not world space like you has suggested me. But thanks for the help! :) \$\endgroup\$ – H. Pauwelyn Jan 4 '16 at 8:47
1
\$\begingroup\$

In most cases 3D elements are always behind the UI elements. If you want to do so, then you have to place your background on Quad rather then any GUI element.

  • Place a unit size Quad.
  • Drop your image on that Quad.
  • Resize Quad according to screen size.

    //*****OR*****//

  • Simply place a sprite in screen.

With either of these two techniques you will achieve your goal.

\$\endgroup\$
1
\$\begingroup\$

I would add an additional Camera to handle the UI 3D elements. Create a new layer (UI3D!?) and make sure your 3d ui elements uses that. Finally set the Camera to render only the new layer using the culling mask.

Using the camera’s culling mask, you can selectively render objects which are in one particular layer. To do this, select the camera that should selectively render objects.

http://docs.unity3d.com/Manual/Layers.html

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.