Mario Coin like rotation

This is not really a question. but for those who might find it usefull:

var rotateSpeed : float = 15.0; //Your speed

function Update () //The update function will trigger your object to make it rotate
{
     transform.Rotate (0.0, 0.0, rotateSpeed * Time.deltaTime); //It never stops rotating.
}

Here is the code for you:
using UnityEngine;
using System.Collections;

public class rotate : MonoBehaviour {

public void Rotate() {

//transform.rotation = Quaternion.AngleAxis(30, Vector3.up);

//var rot = transform.rotation;

//transform.rotation = rot * Quaternion.Euler(0, 90, 0); // this is 90 degrees around y axis

if (transform.up != Vector3.up)
{

transform.LookAt(transform.position + transform.forward, Vector3.up);

//transform.Rotate(Vector3.up * Time.deltaTime *20, Space.World);

}

}

}

Make this answer as correct if i works for you! Thanks.