eddieone Posted May 17, 2016 Share Posted May 17, 2016 I read another topic that talked about physics hacks to make a platform game work correctly. Someone talked about slowing down movement when near a wall to prevent sticking to walls. I tried this and couldn't get a good result. What is the best way to prevent sticking to walls? The problem seems more about velocity than friction. Though, I'm not exactly sure. Link to comment Share on other sites More sharing options...
o0Corps0o Posted May 18, 2016 Share Posted May 18, 2016 Would it be worth using the bullet option? whatever.body.bullet = true; Link to comment Share on other sites More sharing options...
Tom Atom Posted May 18, 2016 Share Posted May 18, 2016 Bullet will not solve it as it makes sure, that your small fast objects (usually bullets) are not tunneling. It looks like you have sensors on your panda (that small circles?) If yes, then completely zero velocity if sensor is touching wall. Link to comment Share on other sites More sharing options...
eddieone Posted May 18, 2016 Author Share Posted May 18, 2016 Yeah those are sensors. I tried using this.body.velocity.x = 0; but I would also need to disable movement in one direction. I will try that and see if it works. Link to comment Share on other sites More sharing options...
eddieone Posted May 27, 2016 Author Share Posted May 27, 2016 Your suggestion didn't work but I did find a solution that I like. In short detect right and left hands separately and reduce the side movement when touching. if (this.leftHand == -1) { this.body.moveLeft(100); } else { this.body.moveLeft(15); // fix wall hug } Link to comment Share on other sites More sharing options...
Recommended Posts