Rendering sword on top doesn't work?

I’ve made two cameras. Here is the hierarchy setup:

alt text

On the first camera I have Culling Mask to everything except my sword, Depth of 0, and the rest of the settings the same.

On the second camera I have “Clear Flags: Depth Only”, “Culling Mask: Sword”, Depth 1, and everything else the same. The problem is that when I position my sword in front of the second camera and play the game, the sword still isn’t rendered on the top:

alt text

Is your sword on the Sword layer?

3 Answers

3

check if the sword is animated, animation holds position data and may be moving the sword away from the camera

It doesn't have any animations.

For my game, I have both the weapon and the second camera as a child of the main camera. You should see if that does it. I think the rest of my settings are the same as what you described above.

he already fixed it, and parenting cameras wont do anything useful in this situation

Hmmm I think I fixed my problem by changing the Clipping Planes Near to 0.01. Now I am able to completely see the sword and it renders over everything.

ok good job, but next time post a comment and not another 'Answer'

If the question is answered it should be an answer. Just be sure to mark it correct next time too.