willis Posted December 20, 2018 Share Posted December 20, 2018 Hi I'm new to phaser, i don't know how to get object properties on click, the result is 'undefined' instead of 8888. I use single object/sprite that not grouped and work fine. create(){ this.cards = this.add.group(); var count = 1; for(var y=1; y<5; y++){ var x_space = 70; var y_space = 100; var y_count = 0; for(var x=1; x<10; x++){ if(count <= 36){ this.cards.create(50+(x_space*x), 100+(y_space*y), 'card_'+count).setInteractive(); this.cards.val = 8888; } if(x==10){ y_count++; } count++; } } this.input.on('gameobjectdown', function(pointer, gameObject){ console.log(gameObject.val); }); } Thanks Solved http://labs.phaser.io/edit.html?src=src\input\game object\destroy sprite on down event.js Link to comment Share on other sites More sharing options...
Recommended Posts