Skip to content

Cameras

The game is seen through an entity with a Camera component, looking along the entity’s forward axis (its -Z). A new scene has none: add an entity and give it Add Component > Camera.

  • Projection: Perspective, as the eye sees, or Orthographic, with no perspective, for 2D games, isometric views and maps.
  • Field Of View: how wide a perspective camera sees, top to bottom, in radians. 1.047 (60 degrees) at first.
  • Ortho Height: how tall an orthographic camera’s view is, in metres.
  • Near Z (0.1) and Far Z (1000): the nearest and furthest it draws, in metres. Keep the near distance as large as the game allows: a small one makes far surfaces flicker against each other.
  • Clear Color: what shows where nothing is drawn, when the sky does not cover it.
  • Primary: whether this is the camera the game uses.

The view’s shape comes from the window, so Aspect rarely matters.

The game draws through the first camera that is Primary, is not drawing into a texture, and whose entity is active. To cut to another camera, make the current one inactive, or turn its Primary off, and the next one takes over.

A scene with no camera at all gets one when it plays: a PlayerCamera looking at the scene’s origin, and a message in the Console. Fine for a first test; give the scene its own camera before long.

In an orthographic view, ambient occlusion, screen-space reflections, screen-space GI and TAA are off.

A camera can draw into a Render Texture instead of the screen: a security monitor, a mirror, a minimap. Make one with Create > Render Texture, set it as the camera’s Target, and use it as a texture in a material. Target Interval draws it only every so many frames, to save time on something that need not be smooth.