physics2D.setJointMotorOn

Section: Physics 2D (Box2D)

What it does

physics2D.setJointMotorOn sets JointMotorOn on a physics2D object. It takes id, speed and force.

Signature

physics2D.setJointMotorOn(id, speed, force)

Arguments

  • id
  • speed
  • force

Example · generated

function update(dt) {  physics2D.setJointMotorOn('main', 1, 10);}

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