hellzone Posted January 5, 2018 Share Posted January 5, 2018 I want to add custom property to my sprite object but when I try to get id property it returns "undefined". Is there a Phaser library bug or am I doing something wrong? My update function; function update() { //When I debug below line I can see enemyTank.tank.id property game.physics.arcade.overlap(enemyTank.tank, mytank.tank, enemyTankHitPlayer, null, this); } Callback function; function enemyTankHitPlayer(myTankSprite, enemyTankSprite) { //enemyTankSprite.id is undefined! } Link to comment Share on other sites More sharing options...
samme Posted January 6, 2018 Share Posted January 6, 2018 function enemyTankHitPlayer(_enemyTank, _playerTank) { // } Link to comment Share on other sites More sharing options...
Recommended Posts