Rotational spring effect

I’m trying to find a suitable way to have an object rotate one way and then spring back the other way slightly less stringly. I’ve tried a few methods such as using transition.to with an onComplete field to reverse the direction and multiply the rotation value by 0.8 but it never looks quite right.
The best I can get so far is to use:

rotationValue = 45  
local direction = 1  
local function spin()  
 transition.to(object, {rotation = rotationValue \* direction , time = 250, transition=easing.inOutQuad})   
 rotationValue = rotationValue \* 0.8  
 direction = -direction   
end  
  

I’ve also tried attaching physics bodies and applying angular impulses, but then it’s not consistent and looks even worse.

I guess what I’m looking for is for it to spin in a way similar to one of these toys:
images.nitrosell.com/product_images/11/2505/large-0GAGO00066.jpg
(If you were to look at one of the discs faces, and let it slow down naturally).

So it would spin to say 90 degrees CW, then to -80 CCW, then 70 CW and so on until it comes to rest.

Has anyone had to do anything similar before that could help me?

Thanks everyone. [import]uid: 84115 topic_id: 29422 reply_id: 329422[/import]