Changing the Lens.OrthographicSize (Cinemachine) Value in Unity in a Script

1.5k Views Asked by At

so im very new to Unity. I make a 2D Plattformer and try to Zoom out when you Press 'Tab'.

I like to change the OrthographicSize from my VirtualCamera via script, but cant figur out how.. any ideas?

Camera follows the Player.

Thanks in Advance!

1

There are 1 best solutions below

0
On

Got a solution!

using Cinemachine; //to use cinemachine

public CinemachineVirtualCamera vcam; //to assign cam

vcam.m_Lens.OrthographicSize = 20; //to access cam, Lens and then OrthograhicSize