camera

Installation
SKILL.md

Camera

A game camera follows a target with clamped pitch+yaw orbit, plus collision and zoom. There is one fork to make first: for a player character, use viverse's ready-made CharacterCameraBehavior out of the box; build a camera from scratch only when you need a fully custom rig. Hand-rolling a character camera tends to reproduce the same bugs — yaw-locked (can't aim up/down) or wall-clipping — which the built-in already solves.

Every custom rig shares one convention: camera.rotation.set(pitch, yaw, 0, 'YXZ'), where positive pitch looks up and positive yaw looks left. The 'YXZ' Euler order is what makes pitch and yaw compose correctly, so it is stated once here and assumed throughout.

The sections below are: Recommended: CharacterCameraBehavior (the built-in for a character), Building a camera from scratch (first-person, third-person, and rest-position variants as ECS systems), and Effects (screen shake and FOV speed). Cross-references: @pmndrs/viverse, and the acta, physics, entity-component-system, and math skills.

Recommended: CharacterCameraBehavior (for a character)

For a player character, prefer this over hand-rolling. CharacterCameraBehavior orbits both axes (pitch and yaw, each clamped), does camera collision against the world, and handles zoom.

import { CharacterCameraBehavior, FirstPersonCharacterCameraBehavior } from '@pmndrs/viverse'

const cameraBehavior = new CharacterCameraBehavior() // third-person orbit + collision + zoom
Installs
121
First Seen
Jun 17, 2026
camera — drawcall-ai/skills