Hello, This is my first time using Cinemachine and I am figuring out how to zoom in or out on my character using the 2D Camera with my mouse wheel. How do I do this in C#? Thank You Very Much.
If you're ortho then dolly won't change anything (because there's no perspective). You'll have to modify OrthographicSize if you want to see a difference onscreen. Just add a script to modify vcam.m_Lens.OrthographicSize according to mouse wheel.
Code (CSharp): using UnityEngine; using Cinemachine; public class Zoom : MonoBehaviour { void Update() { if (Input.GetAxis("Mouse ScrollWheel") > 0) { //GetComponent<CinemachineVirtualCamera>().m_Lens.OrthographicSize = ++; GetComponent<CinemachineVirtualCamera>().m_Lens.OrthographicSize = 5; } if (Input.GetAxis("Mouse ScrollWheel") < 0) { //GetComponent<CinemachineVirtualCamera>().m_Lens.OrthographicSize = --; GetComponent<CinemachineVirtualCamera>().m_Lens.OrthographicSize = 20; } } } Thank you so much for the REPLY