Spin Object in Unity Game Engine


Spin.cs
1
2
3
4
5
6
7
8
9
10
using UnityEngine;
 
public class Spin : MonoBehaviour
{
    public Vector3 speed = new Vector3(0, 0, 90);
    void Update()
    {
        transform.Rotate(speed * Time.deltaTime, Space.World);
    }
}