Pong: Balls stick to Walls (Box2D solution exists)
Posted: Mon Dec 14, 2015 12:42 am
Hey, folks,
I'm making a derpy pong game with the love.physics module for practice, but I'm having an issue where balls stick to walls if they hit them at sufficiently low velocity. I've had this problem with Box2D before, and there, the solution was to set velocityThreshold to zero, as explained here: http://stackoverflow.com/questions/5381 ... s-in-box2d
Elsewhere on this forum, someone had what I think was the same problem. They claim to have fixed the problem by setting friction of all fixtures to zero. I've tried this, but it doesn't seem to fix my problem. Is there some way to access a World's velocityThreshold that I'm not seeing?
Edit: Read the "how to ask for help" thing and realized I hadn't posted a .love file. I have now added one - most of my crap is still lying around in it, but I've added some on-screen prints and adjusted the initial conditions to demonstrate the problem. Note that the horizontal velocity is preserved through the bounces but drops immediately to exactly 0 when hitting the wall, showing friction is not the problem.
I'm making a derpy pong game with the love.physics module for practice, but I'm having an issue where balls stick to walls if they hit them at sufficiently low velocity. I've had this problem with Box2D before, and there, the solution was to set velocityThreshold to zero, as explained here: http://stackoverflow.com/questions/5381 ... s-in-box2d
Elsewhere on this forum, someone had what I think was the same problem. They claim to have fixed the problem by setting friction of all fixtures to zero. I've tried this, but it doesn't seem to fix my problem. Is there some way to access a World's velocityThreshold that I'm not seeing?
Edit: Read the "how to ask for help" thing and realized I hadn't posted a .love file. I have now added one - most of my crap is still lying around in it, but I've added some on-screen prints and adjusted the initial conditions to demonstrate the problem. Note that the horizontal velocity is preserved through the bounces but drops immediately to exactly 0 when hitting the wall, showing friction is not the problem.