|
Is it possible to make a object always render on top of another even if there is another object between it and the camera. Like making the gun in a FPS always render on top even if it goes trough a wall. Im preferably looking for a way to do this with the standard version of unity, and not use any pro-only features.
(comments are locked)
|
|
Best solution is to place a second camera on the scene and put the gun in front of the other camera, set the gun to a layer of it's own and make the second camera only render the gun layer, set the camera to a higher depth than the main camera so that the gun renders over the main view and set it to depth cull so that it doesn't completely hide the main camera. The result is that the gun will always appear above everything else. If you wanted to have the gun get shaded by lights near the player you can place the second camera as a child of the main camera so that the gun and camera move around with the player. This is also how I render special HUD elements like way point arrows and minimaps.
May 22 '10 at 01:28 AM
spinaljack
Hi there, I am trying to set this up but my secondary camera seems to be covering the main one. As far as I can see I have set it to only render one layer and also it has culling on to minimum distance. Have you any idea what I am doing wrong?
Aug 22 '11 at 02:14 PM
Wiplash
The second camera must be a child of the main camera and must have "mouse look" too. On the Second Camera:
On the Main Camera:
...perhaps this can help you.
Oct 25 '11 at 07:32 AM
Edyvargas
(comments are locked)
|
