camera3P.follow

Section: Camera

What it does

camera3P.follow acts on camera3P: it follows. It takes targetId and an options object.

Signature

camera3P.follow(targetId, { offset, distance, smooth, sensitivity })

Arguments

  • targetId
  • { offset, distance, smooth, sensitivity }

    Keys:offsetdistancesmoothsensitivity

Example · generated

function update(dt) {  camera3P.follow('main', { offset: 0.5, distance: 6, smooth: 0.1 });}

camera3P.follow is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

6 members in camera3P