Download

Set rotate 0 when body will stop

Hi, I need the ball to change its rotation to 0 for X and Y when it stops after Add Impulse. I wrote the script, but in the end it is constantly in 0 position.

Screens: http://imgur.com/a/JPkvg

Where is the mistake?