Skip to content

Instantly share code, notes, and snippets.

JISyed / MoveCamera.cs
Last active Apr 15, 2021
Camera movement script in Unity3D. Supports rotating, panning, and zooming. Attach to the main camera. Tutorial explaining code:
View MoveCamera.cs
// Credit to damien_oconnell from
// for using the mouse displacement for calculating the amount of camera movement and panning code.
using UnityEngine;
using System.Collections;
public class MoveCamera : MonoBehaviour