How to create a local multiplayer camera

Hello, i’m trying to make a local multiplayer side scroller game (think super smash bros) and i’m trying to replicate the camera behaviour. From what i’ve understand during the game, the camera adjusts the position (in the middle position of all players? clamped to a min and max value on the side axis) and zoom to fit all players in the view, which means that i have to find out if a player is visible by the camera or not (do you recommend this implementation?), and if there at least one player not in camera, zoom out a little bit (clamped to a min and max zoom out value) and try again. I’ve found this similar question, but it only answers the setting of the external camera which i already did. Can you tell me if i’m heading the right direction or if there is a better way to do this. Thank you