Increase update function call rate w/ matter.js

I am building a pinball game using matter physics and am running into an issue where the fast moving ball will tunnel through the flippers. I’ve gotten around this by lowering the mass on the ball / increasing the mass of the flippers and setting it to a lower speed. However, the ball will still occasionally pass through the flippers undetected.

I was told that increasing the tick rate from 30 to 60 might help with this, but cant figure out how to get it done.

Thanks!

I think matter runs at 60 by default. You can set it by using this.matter.set60Hz(); or this.matter.set30Hz();

However, there is also iteration settings that might help with this. For example positionIterations is 6 as default, maybe increasing it might make a difference. I’m guessing with a pinball game there are not that many physical objects moving around so performance should remain fine!

this.matter.world.engine.positionIterations = 100;

The matterjs docs have lots of info, here you have the specifics about the engine:
https://brm.io/matter-js/docs/classes/Engine.html

Everything is as far as I know accessible in Phaser, but you have to dig around the matter plugin for the scene (this.matter) and also in Phaser.Physics.Matter.Matter (yes double matter) you find the whole matter lib.

As I know, you can’t ask browser to render more frequently than 60 fps.