Camera Controller - syddyd/Tree-Platformer GitHub Wiki

About this Section

A Camera Controller in a modern 3D computer game serves as a critical component that manages the camera's behavior and perspective, essentially controlling what the player sees and how they see it. Its main purposes include:

  1. Perspective Management: It sets the viewpoint of the player, which could be first-person (seeing through the character's eyes), third-person (viewing the character from a distance), or other custom perspectives. This affects how players interact with the game world.
  2. Dynamic Adjustment: The Camera Controller dynamically adjusts the camera's position and orientation in response to gameplay and player inputs. For example, it may zoom in for a detailed view or pull back for a wider perspective during different game scenarios.
  3. Enhancing Gameplay: By controlling the camera, it can focus on important game elements or actions, like highlighting enemies, emphasizing objectives, or showcasing environmental details, thereby enriching the gaming experience.
  4. Player Guidance: It often guides players subtly through the game environment, directing attention to paths, clues, or important game elements, aiding in navigation and story progression.
  5. Collision Handling: The controller ensures that the camera doesn't intersect or pass through geometry (like walls or objects), maintaining immersion and a realistic view.
  6. Cinematic Control: In some games, it aids in delivering a cinematic experience by controlling cutscenes or scripted events, where the camera moves in a predetermined way to tell a story or show specific scenes.
  7. Customization and Accessibility: It can offer options for players to adjust camera settings like angle, zoom, and sensitivity, making the game more accessible and tailored to individual preferences.

In essence, the Camera Controller is a tool for game developers to craft and control the visual narrative of a game, directly impacting the player's experience and interaction with the game world.

Examples of Camera Modes

First Header Second Header
Photo Move the camera around freely to take screenshots
Debug Move the camera around freely to inspect/debug the game. Ignores camera collision
Dialogue Used for dialogue between characters. Can switch perspective to point at the current speaker
Cinematic Used during cutscenes or specific gameplay moments. Employs various camera angles and movements to create a movie-like experience
Side-Scrolling The camera moves horizontally, following the character from the side

Functional Requirements

  • Side-scrolling
  • Photo Mode
    • Is detached from the controlled character.
    • The player can move (keys) and rotate (mouse) the camera freely.
    • The player can move the camera faster while pressing the sprint key.
    • The player can move the camera slower while pressing the walk key.
    • The player can adjust the camera movement speed with the mouse wheel.
    • The player should be able to switch to this mode with a dedicated key input.
    • Should be able to have independent FoV.
  • Debug Mode
    • Similar like photo mode camera.
    • Ignores camera collision.
  • Camera Collision
    • The camera needs to have collision checking with nearby scene geometry, objects, and characters.
  • Should be flexible to have additional camera modes added later.
  • Should work in conjunction with the character controller.
  • Player should be able to switch between different camera modes with assignable input controls (receiving from Input System).
  • Debug camera should be disabled in release build.
⚠️ **GitHub.com Fallback** ⚠️