Jump to content

turn off group gravity


kass
 Share

Recommended Posts

im using arcade physics and i need to turn of my lava group gravity, the sprites i created using tiled keeps falling but i need them to stay in place. here is the code i tried              

 this.lavaGroup.forEach(function(L){          L.body.allowGravity = false;  }, this);
Link to comment
Share on other sites

  • 10 months later...
  • 2 years later...

Are this post isn't any help to you?

because group are collection from many sprite you can't use the body like for sprite. You must use it with setAll()

try this 

Quote

this.enemies.setAll('body.allowGravity', false);

 

it give me no errors . Try it :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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