Camera

Without a proper camera in our game we would be unable to see the player or the world.
A camera is trying to mimic a physical camera in real world. It has a position, orientation, aspect ratio and field of view.

When we talk about cameras in games we usually refer to their behavior. Individual camera behaviors can change the whole genre of the game, therefore it can be coined as one of the most important building block in our game.

Most common camera behaviors in games

Fixed camera

Resident evil 2
resident_evil_2
You just place your camera in the scene without any script

Follow camera

Super Mario Bros 3
super_mario_bros_3
Simplest camera which just follows the target with slight delay

OpenSceneButton OpenScriptButton

First person camera

CS GO
cs_go
Slightly advanced camera which allows the player to look around

OpenSceneButton OpenScriptButton

Third person camera

Red Dead Redemption
red_dead_redemption_horse
Advanced camera which adds certain offset from player. The movement of the camera is called camera orbit as it orbits around the player. When the camera detects collision between player and camera it comes closer to prevent occlusion. It allows custom distance from player by using mouse scroll wheel.

OpenSceneButton OpenScriptButton