Using cinemachine to zoom and follow an object?

I’m making a breakout clone and I’ve added a function where you can increase/decrease the speed the ball is moving at depending on which button is being held down. When the Z button is held down, the ball will move slow. During this particular state, I would like to use Cinemachine to make the camera zoom in on the ball and keep the ball in the center of the screen while it’s in motion. And when the button is released, I want the camera to return to it’s original position. There are very few tutorials on Cinemachine and zooming with it via a button push, and I’m very lost on making this work properly.

Hi Great question. First thing - our Cinemachine forums are the best place for any discussion regarding anything and everything CM

https://forum.unity.com/forums/cinemachine.136/

As for your question, there’s a number of ways to do it. You can have the button press activate a script which turns on a vcam with a tighter zoom. It’s super easy to change camera properties with Cinemachine, just turn on other vcams and if you’ve set the priority to be the same or higher than the current camera, it will take over and either blend / cut depending on how you’ve set the blending environment which lives on the CM ‘Brain’ which lives on the Main Camera.

You can set how any two cameras blend together with the Blend modes on the CM ‘Brain’. It even supports wild cards. So, just turn on your close up camera via a script from the button press and you’re done.