Why does using multiple cameras behave this way?

Using two cameras for an FPS. Main camera renders skybox and everything except weapon layer. Second “weapon camera” renders only depth and weapon layer. This way weapon model does not poke through things.

It seems logical that adjusting FOV on the weapon camera should change the way the items on weapon layer display, no? Why is it that only the main cameras perspective/fov is taken into account?

TLDR Using two cameras on separate layers, why does upper layer camera’s FOV not get taken into account?

This is just curiosity. Trying to understand why things work how they do.

This is not what happens though? Are you sure? What are you doing exactly?

Probabyl I explained bad. Screenshot should help.

Left inspector is main camera. Depth is 0, and it is culling only the weapon layer.

Right inspector is weaponCamera. Depth of 1, and is culling everything except weapon.

If I change FOV on the weaponCamera, I would expect the way the weapon model is drawn on screen to change. Here, the FOV is 30, but the weapon is not different from the mainCameras FOV, which is 60.

Is the weapon camera working at all? (I mean I’m sure you checked, but I have to ask, is the weapon in the right layer?)

Because in that scene view it looks like you have the weapon camera selected and the preview shows absolutely nothing.

yeah it is working, otherwise you cannot see the gun model in the game view.

In scene, the main camera is selected. You can see the weaponCameras projection – it is the smaller one within.

mainCamera is on the FirstPersonCharacter gameObject. Weapon camera is child beneath it.

@AcidArrow

hey thanks for help. It turns out what I expected to happen does happen, I just made a mistake. I must have accidentally changed the layer the actual weapon model was on. I set it back to the correct layer, and now the cameras behave how I expected they would.

1 Like