Gradual rotation to a fixed angle using SmoothDampAngle

Hi everyone, I’m a newbie in scripting here. I need advice on solving this problem here. I just want to rotate the GameObject (with smoothing) by a fixed 90 degrees on x-axis whenever i drag it. This is my script for drag and rotate :

var cubeThing : Transform;
var lastMousePosition : Vector3;

function Update(){

if(Input.GetMouseButton(0)){
    if(Input.GetMouseButtonDown(0)){
        //reset
        lastMousePosition = Input.mousePosition;    
    }
    else if(Input.mousePosition.x < lastMousePosition.x){
        cubeThing.Rotate(
          Vector3.up*(Input.mousePosition.x - lastMousePosition.x));
    }
    lastMousePosition = Input.mousePosition;
	
	
}

}

Thus is my problem now. I do not know how to make it perform a gradual rotation. My only clue after researching is that Mathf.SmoothDampAngle is the key to my answer but I do not know how to apply it after multiple failures. I’m pretty sure I’m just totally misunderstanding the concept of how to either use SmoothDampAngle, or how to then apply it to rotation over time. Any form of help will be greatly appreciated.

Many thanks.

Anybody? Totally need help here =(

Take a look at Quaternion.Slerp

There is also a nice code same that will do the rotation slowly over time for what you need.