Unity Cookbook
  • 2D
    • New Input System - 2D Move
    • Pixel Sprite Setup
    • Animations
    • Animator in Script
    • Tilemap
    • 2D Camera Follow Player
  • UI OnlyFans
    • 9-Splice Sprite
    • Interactible Game Objects
      • NPCs
      • Items
      • Interactible Marker
    • Dialogue System
      • Conversa Plugin
      • DiaManager.cs
      • DiaTrigger.cs
      • DiaManager.cs Alternate
      • Choices in Dialogue
    • New Input System - Interact
    • Designing the General Menu
    • New Input System - Open Menu
      • UI Buttons
      • GeneralMenu.cs
    • Controls Explanation UI
    • Items Menu
Powered by GitBook
On this page
  1. 2D

2D Camera Follow Player

Use Cinemachine.

PreviousTilemapNext9-Splice Sprite

Last updated 1 year ago

If you are looking for Cinemachine, install it from the package manager like you did with the input system.

Reference Video: https://www.youtube.com/watch?v=mWqX8GxeCBk

Steps:

  1. Right click in the scene menu -> Cinemachine -> Pixel Camera

  2. Drag the player GameObject in the scene into the Camera's "Follow" target

Deadzone width and height refer to the area the player can move around in before the camera moves.