How do I apply angular force (torque) with Matter physics?

Hey everyone.

When using Matter.js directly, I can apply torque (angular force) to bodies by setting a body’s torque property in the world update step. (see Matter.js docs)

I can’t figure out how to do it in Phaser 3. The only related thing I can find is setAngularForce, which (not surprisingly) immediately sets the angular force, which is not the same thing as applying an angular force.

Any pointers?

Thanks,
Hendrik

Edit: this is in Phaser 3.22, btw.

Little late, but reference for future searchers.

Seems that there is a property GameObject.body.torque that you can set :slight_smile:

For matter objects the body is of type MatterJS.BodyType. I’ve yet to find the documentation for that type. It doesn’t seem to exist on the Phaser docs page. Maybe it’s somewhere in the Matter’s own documentation :person_shrugging:

1 Like