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.
asked May 22 '10 at 01:18 AM
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.
answered May 22 '10 at 01:27 AM