Skip to content

camera

Everything about how the song is framed: the zoom and the little pop on every beat - and in a fight, the camera behind your fighter itself. Where it stands, where it looks, how wide its lens is.

How to use it

camera is always there, you don't have to set anything up. Change a value, tween it, and when you're done, put it all back with reset(camera) or resetCamera([duration]).

  • In every song: zoom, bump, bumpEvery, bumpStrength, shake.
  • Only in fights: x, y, z, yaw, pitch, roll, fov and nudge move the camera that stands behind your fighter. Practice has no world, so there they simply do nothing. And only you see your camera move - your opponent has their own.

Shortcuts: zoom, shake, focus. How it all fits together: The fight camera.

Psych: camGame.zoom, cameraShake, triggerEvent('Camera Follow Pos') · Kade: cameraZoom, cameraAngle

Example code

format 2.0
-- Bump on every beat, and look over at the opponent for two beats.
event { name = "Look Over" }

function onBeat(b)
    camera.bump += 0.03
end

function onEvent(p)
    tween(camera.yaw, -6, beats(1), "sineInOut")
    tween(camera.fov, -8, beats(1), "sineInOut")
    after(beats(2), function() resetCamera(beats(1)) end)
end

Properties

Property Kind Default
camera.bump number 1 The pop you see on the beat. It sits on top of zoom, and the game eases it back to 1 …
camera.bumpEvery number 4 The game's own bop: every this many beats the camera pops to bumpStrength (below 1 …
camera.bumpStrength number 1.02 How far the game's own bop pops (1.02 = 2 % closer).
camera.shake number 0 How hard the screen shakes, as a share of its width. 0.01 is already noticeable; 0.05 is …
camera.zoom number 1 A zoom that stays until you change it: 1.2 is a bit closer, 0.9 a bit further out. In a …
camera.x number 0 Moves the fight camera to its right (negative = left).
camera.y number 0 Moves the fight camera up (negative = down).
camera.z number 0 Moves the fight camera forward, into the picture (negative = back).
camera.yaw number 0 Turns the fight camera to the right (positive) or left.
camera.pitch number 0 Tilts the fight camera up (positive) or down.
camera.roll number 0 Rolls the picture clockwise - on top of hud.angle, which rolls the camera with the HUD. …
camera.fov number 0 Added to the lens: negative zooms in (a tele lens), positive goes wide.
camera.nudge number 1 On every note you hit, the camera leans a tiny bit in the note's direction. This is how …

camera.bump

number camera.bump = 1

kept at the song's end

The pop you see on the beat. It sits on top of zoom, and the game eases it back to 1 all by itself - so don't set it, add to it. That way your pop and the game's own bop stack instead of cancelling out.

camera.bump += 0.03

camera.bumpEvery

number camera.bumpEvery = 4

kept at the song's end

The game's own bop: every this many beats the camera pops to bumpStrength (below 1 counts as 1). To switch the bop off, set bumpStrength to 1.

camera.bumpStrength

number camera.bumpStrength = 1.02

kept at the song's end

How far the game's own bop pops (1.02 = 2 % closer).

camera.shake

number camera.shake = 0

How hard the screen shakes, as a share of its width. 0.01 is already noticeable; 0.05 is an earthquake. It keeps shaking until you tween it back to 0 - or use the shake shortcut, which calms down on its own.

camera.zoom

number camera.zoom = 1

A zoom that stays until you change it: 1.2 is a bit closer, 0.9 a bit further out. In a fight the world zooms with it, not just the HUD.

camera.x

number camera.x = 0

blocksfights only

Moves the fight camera to its right (negative = left).

camera.y

number camera.y = 0

blocksfights only

Moves the fight camera up (negative = down).

camera.z

number camera.z = 0

blocksfights only

Moves the fight camera forward, into the picture (negative = back).

camera.yaw

number camera.yaw = 0

degreesfights only

Turns the fight camera to the right (positive) or left.

camera.pitch

number camera.pitch = 0

degreesfights only

Tilts the fight camera up (positive) or down.

camera.roll

number camera.roll = 0

degreesfights only

Rolls the picture clockwise - on top of hud.angle, which rolls the camera with the HUD. hud.angle = 180 and camera.roll = -180 together turn only the HUD upside down, the world stays upright.

camera.fov

number camera.fov = 0

fights only

Added to the lens: negative zooms in (a tele lens), positive goes wide.

camera.nudge

number camera.nudge = 1

0 – 5fights only

On every note you hit, the camera leans a tiny bit in the note's direction. This is how much: 0 switches it off (nice when your own script moves the camera, or for a calm part), 2 makes it twice as strong.