hvj Posted May 2, 2014 Share Posted May 2, 2014 I'm getting exception when I destroy a sprite on a collide.I'm detroying that sprite onEndContact of collision. Exception is:"this.sprite is null" on first line of "postUpdate" file. /** * Internal method. This is called directly before the sprites are sent to the renderer and after the update function has finished. * * @method Phaser.Physics.P2.Body#postUpdate * @protected */ postUpdate: function () { this.sprite.x = this.world.mpxi(this.data.position[0]); this.sprite.y = this.world.mpxi(this.data.position[1]); if (!this.fixedRotation) { this.sprite.rotation = this.data.angle; } }, Link to comment Share on other sites More sharing options...
Recommended Posts