How to Make a Interactive Camera using Cinemachine and C#

Here’s an easy way to add an interactive zoom to your Virtual Camera in Unity by ‘using Cinemachine’ GetComponent<CinemachineVirtualCamera>().m_Lens.FieldOfView.

Here we have a simple scene that includes a Virtual Camera, a Plane, an animated Cube and a Sphere:

Adding this script will allow us to update the Field Of View on the Virtual Camera:

And here is the result:

--

--

--

Unity and Flutter developer interested in creating mixed-reality applications.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 10 MS Teams hidden features to increase your productivity

Three Reasons Why I Delete Apps — Tj Writes Stuff

What boost can Apple’s M1 give to Redis?

Day 5 — Getting started with AppArmor

Feedback-Centric Development — The One Hacker Way

Snails Finance Community Survey NFT Event Results

The Automation of Visual Design and How Designers Benefit from Coding

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Richard Morgan

Richard Morgan

Unity and Flutter developer interested in creating mixed-reality applications.

More from Medium

Day 112: Animated Tile Maps

Virtual Cameras

High-Definition Rendering Pipeline in Unity!