How to instantly stop the rotation of an object in BGE? I can't stop the rotation of the camera(around the z global axis), in BGE. The camera is set to dynamic. Here is part of the script, the only one that affects rotation.

def rotation():
    if (mX &lt; 0.10) and (mY &lt; 0.90):
        cam.setAngularVelocity([0, 0, 0.1], 0)
    elif (mX &gt; 0.90) and (mY &lt; 0.90):
        cam.setAngularVelocity([0, 0, -0.1], 0)
    else:       
        cam.setAngularVelocity([0, 0, -cam.getAngularVelocity().z], 0)
    #print (cam.position)
    print ("Angular Velocity :",cam.getAngularVelocity())


Setting the angular velocity to 0 does not work.So what I did was to subtract the current value(cam.getAngularVelocity().z). This kills the rotation but it is still slow and it creates a flickering effect.

I found 2 threads about this thing in other forums. They were unsolved. Any thoughts?

Here is the blend file
This appears to be a reported bug

Workaround: use a very small value like 0.00000012

def rotation():
    if (mX &lt; 0.10) and (mY &lt; 0.90):
        cam.setAngularVelocity([0, 0, 0.1], 0)
    elif (mX &gt; 0.90) and (mY &lt; 0.90):
        cam.setAngularVelocity([0, 0, -0.1], 0)
    else:       
        cam.setAngularVelocity([0, 0, 0.00000012], 0)