physics2D.getNextContact

Section: Physics 2D (Box2D)

What it does

physics2D.getNextContact reads NextContact on a physics2D object. It takes no arguments.

Signature

physics2D.getNextContact()

Arguments

It takes none.

Example · generated

function update(dt) {  const nextContact = physics2D.getNextContact();}

physics2D.getNextContact 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.

7 members in physics2D