How to make a configurable camera with the new Unity Input System

Introduction

Last Update: Oct 17, 2019

unity input-system C#

Project Files

This tutorial was created with Unity version 2019.2.

In this tutorial, you’re going to build a configurable camera that handles moving, zooming and rotating. This design works great for games that do not want an attached 3rd or 1st person camera, but instead want freedom to move around a scene. Instead of using the old input system, we’ll be hooking it up to the new one and will review key concepts as we go.

Configuration features of the camera are:

  1. Camera angle
  2. Zoom min/max
  3. Zoom default
  4. Look offset (where you want the camera to focus on the y axis)
  5. Rotation speed

Learning Outcomes

You can clone this repository to get the starter project and follow along!

  1. Understand key concepts of the new Input System.
  2. Have a configurable camera that can be customized for your game.

Prerequisites

This tutorial assumes you have basic knowledge of how Unity works. It does not cover the basics, such as what a GameObject is, a component, when Start is called, etc.

Demo of Final Result

Tutorials in this Series

  1. Part 1: How to make a configurable camera with the new Input System
  2. Part 2: Listen for the Input System Action events via CSharp
  3. Part 3: How to select multiple objects based on the center of a collider
  4. Part 4: Challenge Solution: Extending the selection logic

Resources

  1. Input System documentation and GitHub repository.
  2. Introducing the new Input System - Unite Copenhagen Video
  3. This project uses the Low Poly: Free Pack by AxeyWorks.