Phaser 3 has great collision detection out of the box, but you may experience 'sprite tunnelling' or sprite overlapping issues when two or more sprites collide. If your intention is to have colliding sprites rebound from each other rather than overlap then you will at some point experience issues where sprites tunnel into each other rather than rebound as intended.
A quick and easy way to help prevent this is to set the Frames Per Second or FPS value for your scene to 120 e.g.
this.physics.world.setFPS(120);
I have also found that combining this with a bounce factor on each colliding sprite type to work a treat:
this.body.setBounce(1);
Suffering from Phaser 3 sprite overlap or tunnelling issues during collision? this could help...
Why not read my other blog articles on Phaser 3 game development.
Leave Your Comments...