How can I make camera automatically change its location ,so that it would adjust to the models of different size?

So lets say you have 1 Pawn with a camera and want to move between objects with various sizes with a mouse click:

Image from Gyazo