I am trying to create a box2d ball that rolls along the ground when the screen is tapped. In my OnMouseDown function, i have this:
ball.body:setAngularVelocity(10) |
I wanted it to stop rotating when you lift up your finger, so I put this in my OnMouseUp function:
ball.body:setAngularVelocity(0) |
I tried this out, however, when I release my finger, it only slows the ball down. Shouldn't it make it stop completely, since it is basically setting the angular velocity of the object? Or am I missing something here?
Comments
AngularImpulse (and impulses in general) tend to give more natural behaviours, so I'd stick with using them if that works in your game.