Add colider group of player and setCollideWorldBounds

Hello
For my first mage an multiplayer shootem up.

I try to have players who are blocked by world bounce and also block by the others players.

I created players with self.physics.add.sprite() and setCollideWorldBounds on it
After that i add those players in a add.group()

but in the same time i would like use the physics.add.collider(playersGroup);

and i donk know why the collider not working ?
and if i change my group by a physics.add.group(), the collider works but not setCollideWorldBounds anymore.

i am shure i mix a little bit everyting but dont find the way to have thos twoo options set, i lokked at the https://www.phaser.io/examples/v3/view/physics/arcade/sprite-vs-sprite exemple but didn’t succed.

eg:
function create() {
self = this;
// remove physics and collider works but not setCollideWorldBounds on player
playersGroup = self.physics.add.group();
self.physics.add.collider(playersGroup);
socketOn();
}

function addPlayerToPhaser(self, playerInfo) {
const player = self.physics.add.sprite(positionPlayerExtra[playerInfo.position], playerInfo.y, ‘player’);
player.id = playerInfo.id;
player.setCollideWorldBounds(true);
player.setDepth(2);
// player.play(‘player_anim’);
playersGroup.add(player);
}

Add player to group first, then modify player.

1 Like