Arcade Collision help

I’m having a problem handling when objects push past each other with collisions on.

This is the code I edited the ClownExample clown# 2 just runs through clown #1.

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    parent: 'phaser-example',
    physics: {
    default: 'arcade',
    arcade: { debug: true }
    },
    scene: {
        preload: preload,
        create: create
    }
};

new Phaser.Game(config);

function preload ()
{
    this.load.image('block', 'assets/sprites/block.png');
    this.load.image('clown', 'assets/sprites/clown.png');
}

function create ()
{
    var block = this.physics.add.staticImage(600, 300, 'block');
    var clowns = this.physics.add.group();
    clowns.create(200, 300, 'clown').setVelocityX(100);
    clowns.create(150, 300, 'clown').setVelocityX(300);

    this.physics.add.collider(clowns)
    this.physics.add.collider(clowns,block)
}

Generally, Arcade Physics bodies don’t pack/stack well. You can try

  • .setPushable(false)
  • increase physics FPS
  • stopping bodies after a collision, if appropriate

Setting pushable to false fixed all my problems … once I figured out that I had to update to the 3.5 build.

Thanks samme you the best!

Hello,
I can help.
Just want to know if it’s a paid gig?