khleug35 Posted October 4, 2018 Share Posted October 4, 2018 game.createScene('Main', { gravity: 2100, init: function() { this.world = new game.Physics(); this.world.gravity.y = this.gravity; ...... }); game.createClass('Bird',{ ....... this.body.velocityLimit.y = 1; //It can make the sprite prevent gravity ...... }); I use this code to make some sprite prevent gravity this.body.velocityLimit.y = 1; but I think this is not best way to solve problem. the sprite can't move to y position any idea?? Thanks Quote Link to comment Share on other sites More sharing options...
enpu Posted October 4, 2018 Share Posted October 4, 2018 Try to set body mass to zero. this.body.mass = 0; khleug35 and Wolfsbane 2 Quote Link to comment Share on other sites More sharing options...
khleug35 Posted October 5, 2018 Author Share Posted October 5, 2018 20 hours ago, enpu said: Try to set body mass to zero. this.body.mass = 0; @enpu Thank you for your help , It work!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.