Jump to content

Group.callAll() question.


Recommended Posts

Hello! I was trying to change the size of each sprite in the group and i used this: 


it resulted to an error : 

Uncaught TypeError: Cannot read property 'setTo' of undefined phaser.js:51065Uncaught TypeError: Cannot read property 'x' of null phaser.js:50385

but when i did this :

this.spikes.forEach(function(sprite){    sprite.body.setSize(10,10,10,10); },this);

It worked correctly. Where  is my mistake? Why the first way does not work for me?


Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...