Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Lieven on September 05, 2013, 12:42:16 PM
-
Hello,
I am trying to make a scene with NGUI where the player's vehicle transforms from a submarine to a car and later on from a car to a helicopter.
The idea is to do this with a UITexture in the background and the vehicle in front of it. I did manage to do this when the game is not running, I mean I can see the vehicle in front of the background plane when I open the game view of the scene, but whenever I hit the play button, the background comes in front of the vehicle. I work with 2 cameras for this purpose: a game camera to render the vehicle and a NGUI 2D camera to render the background. I thought it would be as simple as to make my vehicle camera render after the gui camera to make the vehicle pop up in front of the background, but this does not seem to work when I start the game.
I have been trying out some camera settings, but nothing seems to fix the problem. Is there something I am missing here?
The settings for the vehicle camera are:
- Clear flags: Depth only
- Culling mask: Mixed (All except the UI layer)
- Perspective Camera
- Depth: -1
The settings for the gui camera are:
- Clear flags: Skybox
- Culling mask: UI
- Ortho Camera
- Depth: -2
Thanks in advance,
Lieven.
-
This seems unusual... you're drawing your UI camera before the game camera?
In any case, yes that's how it works. Camera with higher depth is drawn later.
-
Couldn't really get it to work with the 2 cameras, but I fixed it by using only one camera and a 3D GUI. So for me the issue is solved, but it still exists. I know I tried to do something unusual, but it should've worked I think.