Jump to content

Group.callAll() question.


j0hnskot
 Share

Recommended Posts

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

this.spikes.callAll('body.setSize',null,10,10,10,10);

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...
 Share

  • Recently Browsing   0 members

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