Sam Posted April 29, 2015 Share Posted April 29, 2015 I'm getting stuck with this issue. I've updated my projects from phaser 2.2 to current 2.3.0. and every collision isn't working any more. I'm using the arcade.physics system. Set up is (shortened): the collision handler does not fire.Group 1this.wave = this.add.group();this.wave.enableBody = true;this.wave.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(this.wave, Phaser.Physics.ARCADE);Group 2this.player = this.add.group();this.player.enableBody = true;this.player.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(this.player, Phaser.Physics.ARCADE);into update func:game.physics.arcade.collide( this.player, this.wave, this.collision, null, this);does not detect anything.Same goes with sprite vs. sprite, worked before.I tried different configurations since there are multiple ways and I do not know which one is actually the most updated:wave_obj.physicsBodyType = Phaser.Physics.ARCADE;game.physics.enable(wave_obj, Phaser.Physics.ARCADE);this.game.physics.arcade.enable(wave_obj);game.physics.arcade.enable( wave_obj );console output contains: type: 0 and physicsType: 0 - is that correct?c.Sprite {type: 0, physicsType: 0, position: c.Point, scale: c.Point, transformCallback: null…}Any ideas? suggestions, I've tried every syntax written above. with phaser 2.2 it worked. also tried:game.physics.startSystem(Phaser.Physics.ARCADE);game.physics.arcade.TOP_BOTTOM;with sprite vs spritegame.physics.enable( [ this.racer, wave_obj ], Phaser.Physics.ARCADE);game.physics.arcade.overlap instead of game.physics.arcade.collideregards Link to comment Share on other sites More sharing options...
Sam Posted April 29, 2015 Author Share Posted April 29, 2015 Found the problem, but I wonder that it worked before: this.wave.addChildAt( wave_obj, i_counter );I just rewrote it to this.wave.add( wave_obj ); <- sprite gets added to group.this.wave.addChildAt( wave_obj, i_counter ); Does not work but adds the sprites to the group successfully..so this may be something to fix, or I even misunderstood the usage? Link to comment Share on other sites More sharing options...
rich Posted April 30, 2015 Share Posted April 30, 2015 addChildAt is a Pixi level method and as such it skips the set-up that Group.add performs on a child, which in 2.3 includes adding it to the sort hash that physics uses. Link to comment Share on other sites More sharing options...
Recommended Posts