So we have this topdown arena level, where the camera is a framing composer following the player and there is a cam confiner so when at the border of the arena it doesn’t zoom too far out to irrelevant parts,
this works awesome so far, now we have a boss level where I still want the camera to do the same, but also sort of frame the boss, as in if the boss would leave the image, to kind of “zoom” out and show a bigger image of the map.
I did a copy of the first cam, then adjusted the camera distance (made it bigger), and it also needed its own confiner to propery… confine (not show unecessary parts but also don’t cut off too early)
I’ve tried various things, currently I did a mixed camera where I added both cams and when I change the values the interpolation looks nice. Now how to I best add the “frame boss” functionality?
Or is there another, better way of achieving what I want to do?
Love cinemachine but it gets overwhelming fast with all the options (which is great that they are there, but still overwhelming )
Hi, thanks for the fast answer!
Sure, here you go:
So this is the main cam we’ve been using so far, no idea if this is the best way to approach it, but so far it has worked out exactly as we wanted
This is how it looks like:
This is the new Zoomed Out cam, pretty similar to the other one (more distance and has it’s own confiner):
This is a litte comparison, not perfect yet and needs more tweaking, but I hope this visualizes what I have in mind
(left one is with the NPC and more zoomed out. so the idea is to smoothly transition between both cams according to where the player and NPC are. so when they are next to each other it’s 100% main cam and maximum zoomed in, when they are at the opposite side of the map maximum zoomed out etc
Haven’t done much else, I just created a mixed camera and added both cams and just manually tweaked the available values and the interpolation looked awesome and smooth
What version of Unity are you using?
I ask because if it’s 2022.3 or above, you should consider upgrading to CM3.
Have you tried using a CinemachineTargetGroup and adding your player + the NPC to the group? If you use the group as the camera target, the Framing Transposer can be configured to keep the group framed (by zooming or dollying, or some combo of both).
Hello!! Thanks for all your answers and taking the time to do this!
That is not only possibly, more like probably I tweaked around a bit yesterday and it worked better but then I got lost in “Yay, now just a little tweak and it’s PERFECT… Fuck, now this needs tweaking too… now this doesn’t work how I’d like it too” for like 3484847 times until I gave up
Soooo the scene you sent pretty much sums up what I want! I just copied some settings to my scene and I like it better already, so thanks for that!
I’ve been thinking about it a bunch now and I think my main issue now remaining is that I’d need two different confiners according to cam distance.
Example:
This is the confiner that works great for when they are far apart. Sadly, when they are close and at the border of the map it zooms too far out
If I change the confiner to cut away the unecessary parts, I can’t in this example see the player anymore
This is why I also tried the mixed cam thing with two cams with fixed distances and each their own confiner,
where I manually tweaked the values and thought the interpolation looks nice.
Hope this made sense, do you have advice on how to best approach this?
I think that it might be difficult at this angle to have a camera that can see the entire arena, including both front corners, without zooming too much. Have you considered adding another camera at a different angle that sees the entire board? You can switch to that camera when the others have trouble seeing both players.