I have a number of objects that I want to serve as visual landmarks in an open world game; I think I understand how I would have them appear at any distance using two nested cameras and some different layers, but I can’t get it to work using cinemachine…
As it is, Camera B doesn’t seem to render the sword at all, even though I have it on the culling Mask “Infinite Range” and Camera A has Infinite Range disabled.
I think I’m beginning to understand your difficulty.
Virtual cameras are not cameras - they’re just game objects that the Camera uses (via the CinemachineBrain) to position itself. There is only one Camera, and it only has one layer mask. Setting the layers of the vcams just puts them on the layers - it doesn’t affect the Camera’s layer mask.
You don’t attach Cameras to virtual cameras - I’m not really sure what you mean when you say you have Cameras A and B attached. You should just have one Camera, with a Brain on it, as a separate game object (no parental or child relationship to the vcams).
Note that the CinemachineBrain will only consider vcams on layers that the Camera can see (i.e. not filtered out by the mask). That’s how you would “attach” a camera to a virtuual camera.
If you want to set up a second Camera with a different mask, you can do that. You may or may not choose to use Cinemachine to control that camera as well. If you do, you can give it a CMBrain. In that case, you’ll have to put the vcams that control the second camera on a layer that the second camera can see, and not on a layer that the first Camera can see.
So I have a CM FreeLook object, and it’s the parent of a Camera with the Cinemachine Brain on it. I don’t need these to have any parent-child relationship?
The brain filters the vcams by using the camera’s culling mask. Put FreeLook A on layer A, and have Camera A’s culling mask include layer A but not layer B. Do the corresponding thing for FreeLook/Camera/Layer B.
Are both cameras rendering? Where does the output go? Can you, as an experiment, adjust the viewports so that each camera renders on a different half of the screen? I notice that FreeLook A is not live in its brain.
It’s good that the sword is rendering.
At this point I don’t understand what you’re expecting to see when you make the top camera occupy the whole screen, other than the top camera’s output. Where are you wanting to see the sword?
I’m also making the bottom camera occupy the whole screen.
I’m looking to get the sword to render at any distance. It should be rendering in the distance regardless of how far away the player is because it’s on a separate render layer that would be dedicated to far away objects/terrain that are large enough to matter visually.
All Cinemachine does is to position the cameras. If you put the cameras in their respective positions and disable CinemachineBrains, does it render as you want it to? If not, then the problem is in your layering setup.