Phaser AE

First-Person Camera Rig

Free packv3.0.0-23DRigs

The camera for any game played from the eyes: a walker, a shooter, a maze, an architectural tour. Mouse look, WASD movement, sprinting and flight are handled, and the rig leaves walls and ground to your game through two simple hooks.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

First-Person Camera Rig: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

What it does

Mouse look works locked or unlocked. The first click asks the browser for pointer lock, which hides the cursor and reports raw movement; before that, or on a browser that refuses, a held drag turns the view just the same. A game is playable the moment it loads rather than after a click. Pitch is clamped so the view cannot roll over.

WASD or the arrows move relative to where the player looks, and shift sprints. While walking, movement is flattened to the ground, so looking up never lifts anyone off the floor, and the eye stays at eyeHeight. With fly on, forward follows the view up and down, and space and control rise and fall. The rig keeps the world camera at distance 0, which is what makes it an eye rather than an orbit, and writes only the camera's position, yaw and pitch.

Walls are the game's business. Each step the rig publishes intent, where the player is trying to go, and previous, where they started; a game with geometry reads both, decides where the player may actually stand, and calls moveTo. With nobody clamping, the proposal is simply taken. For terrain, set floor to a height function and walking follows the ground, and canMove can refuse a step for a slope, a cliff, a tree trunk or the edge of the world.

Features

  • Mouse look from the first moment — pointer lock on the first click, and drag-to-look before it or without it.
  • View-relative movement — WASD and the arrows, flattened while walking, with a sprint multiplier on shift.
  • Optional flight — forward follows the view, with space and control to rise and fall.
  • Intent for walls — intent and previous each step, and moveTo to place the player where the game allows.
  • Ground and limits — floor for terrain height and canMove to refuse a step.
  • Comfort settings — sensitivity, inverted vertical look and pitch limits.

Good for

  • First-person exploration — walking over hills and through forests with the eye on the ground.
  • First-person shooters and mazes — walls handled by your own collision through intent and moveTo.
  • Architectural and scene tours — a walk-through or a fly-through of a model or a level.
  • Free flight over a landscape — forward follows the view, with space and control for height.
  • Games that must play instantly — drag-to-look works before any click.

Make it yours

The options set the walking speed and sprint multiplier, the eyeHeight, whether the player starts flying, mouse sensitivity and invertY, the minPitch and maxPitch limits, whether to lock the pointer at all, and the start position. speed, fly, eyeHeight, the position and the look are live properties too.

Two quite different games: a hillside walk where floor reads the terrain's height and canMove refuses slopes too steep to climb, so the player follows the ground and turns back at cliffs; and a maze shooter on a flat floor whose own grid collision reads intent and previous each step and calls moveTo with the nearest position clear of the walls.

A quick look

Walking a terrain, with steep slopes refused:

game.rig.floor = (x, z) => game.terrain.heightAt(x, z);
game.rig.canMove = (from, to) => game.terrain.slopeAt(to.x, to.z) < 0.5;

Works with

  • world-3d — the 3D world whose camera it drives.
  • terrain-3d and terrain-world-3d — the ground heights that walking follows.
  • rig-orbit — the alternative for a camera that looks at something from outside; a game has one or the other.
  • rig-minecraft — the block-game scheme, with jumping, breaking and placing.

Good to know

  • It has no collision, gravity, jumping or step-up of its own: intent is where your game adds them.
  • Pointer lock needs a user gesture, so the first click arms it; if the browser refuses, drag-look keeps working.
  • The keys are WASD and the arrows with shift to sprint, and they cannot be rebound yet.

More Rigs packs

Show all →