Simple Coin Spin Script for Unity 5

Add this simple Coin Spin Script to any Object in Unity 5 to make it rotate.

Create a new blank JavaScript file and paste the following code into it. Then just drag the JavaScript file onto any object you want to make spin.

function Update () {
transform.Rotate(0, 2, 0, Space.World);
}

Here is the C# script version for Unity 5

using UnityEngine;
using System.Collections;

public class coinSpin : MonoBehaviour
{
public float spinSpeed = 10f;
void Update ()
{
transform.Rotate(Vector3.up, spinSpeed * Time.deltaTime);
}

}

Leave a Comment