Cinemachine - Group Framing overriding Position Composer - how to handle?

So, alongisde of upgrading my current project to Unity 6 I also upgraded Cinemachine to the latest version from a very old one. Everything wen’t well, except one issue I haven’t been able to fix:

  • I’m using Camera Target Group when Player is in combat to frame all actors on screen
  • I’m adding/removing Targets to the target group dynamically
  • In the previous version I was using there was the Framing Transposer that had both Dead Zone and Group Framing options, so this affected the active Cinemachine Camera as follows: when there were any other Targets than the Player in the target group the camera would frame everything nicely, and when there was only the player in the target group, it would still respect the Body settings like DeadZone, Screen Position X/Y, nicely blending between the two states
  • In the new Version with the Position Composer and Group Framing components, the Group Framing component completely overrides any and all settings of the Position Composer, completely ignoring Dead Zone, Screen Position etc even if there’s only 1 target in the Target Group. I need it to respect the settings Position Composer when there’s only 1 target (i.e. the player) in the target group.

Now, suspecting this might unfortunetly be expected behaviour this is the solution I tried:

  • Monitoring the Target Groups Targets list, and if there is more than 1 object, toggle the GroupFraming component of the active CM Cam On, otherwise toggle it off. Now while this works, it produces an ugly hick-up when the GroupFraming is activated/deactivated. Seemingly not a good solution.

The other obvious solution I see that I’d like to really avoid however because it would overcomplicate and introduce issues in my project:

  • Create a separate Cm Cam with Group Framing Composer that is only activated when the Target Group has more than 1 element, otherwise a Cm Cam without Group Framing Composer is on. Like I said, I’d like to avoid this solution at all cost because it would break a lot of my current project architecture (having to basically double each Vcam/CMcam in the project)

Soo, any ideas what would be the correct approach in this situation? Is there any way to get the old behaviour back of a Camera respecting both, the Position Composer AND the Group Framing? Any replacement for the deprecated Framing Transposer?

Unfortunately the new behaviour is the intended one.
My suggestion would be to do exactly what you want to avoid at all costs :frowning:

Here’s an idea: continue to use the deprecated Framing Transposer. It should work just fine within the CinemachineCamera. If you like, you can copy the code and paste into a new custom behaviour, so that it’s not deprecated (although you may have cosmetic issues with the inspector - worth a try, though).

1 Like

Hi Gregory, thanks so much for the swift response! Oh, I didn’t realize that was an option! I did just that - copied the FramingTransposer code in a custom script and it seems to work perfectly fine so far. I’ll have to do so more testing, but seems completeley viable. If I run into major problems with this solution I will consider the option of having a separate combat-cam down the line.

Only thing it’s missing are the on-screen guides (dead/soft zone, Lookahead indicator in Game-window) which isn’t that important to me, but just out of curiosity and without having studied the code myself yet - do you think it would be hard or even possible getting those working again? If possible, where would I even start?

Thanks again! Have a good day.