kass

turn off group gravity

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);

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.