I’ve been in love with Cinemachine since I first installed it. It’s easily the best camera system I’ve used, and I’ve tried lots. My game features a non-humanoid (quadrupedal) main character, and Cinemachine’s flexibility completely sidesteps a bunch of the bipedal assumptions that always seemed to lurk in lots of other packages.
I have my FreeLook Camera’s Screen X value set to frame my character in a nice classy Rule-of-Thirds-y way, and it works great. But I’m greedy, so I’d like it to be even nicer. What I’d love to do is to blend between left-aligned framing and right-aligned framing when appropriate. Here are some images to illustrate:
In the first image, the composition looks just how I’d like it. In the second image, the composition is worse: with the character framed in the left third, the right half of the screen is nothing but a whole lotta wall.
What I’d love to do is detect these situations and blend over to a camera that frames the character on the right side of the screen (or in the center, when I detect that the player is in narrow passageways).
I wrote a small component that detects distance to walls on the left or right, and successfully used it to drive the FreeLook Rigs’ Screen X values, but it doesn’t feel as buttery smooth as everything else that Cinemachine does. It also feels like there ought to be a more Cinemachine-y way to do this and that I’m missing something.
Is there something clever I could do with a StateDrivenCamera (these only seem to key off animation states – could I define custom LeftSide/RightSide states somewhere and drive it that way)? Something with ClearShot and colliders? I understand that detecting the need to transition between these shots is subjective and I wouldn’t expect Cinemachine to magically know which one I want, but is there something better I should be doing to switch between them?

