Skip to content

Instantly share code, notes, and snippets.

@kaiware007
Created September 16, 2018 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaiware007/a00ce9e014a8695f41a8eef4b38aabdb to your computer and use it in GitHub Desktop.
Save kaiware007/a00ce9e014a8695f41a8eef4b38aabdb to your computer and use it in GitHub Desktop.
Auto rotate Script for Unity
using UnityEngine;
public class AutoRotate : MonoBehaviour {
public Vector3 axis = Vector3.up;
public float rotSpeed = 100;
void Update () {
transform.rotation *= Quaternion.AngleAxis(rotSpeed * Time.deltaTime, axis);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment