Created
September 16, 2018 20:03
-
-
Save kaiware007/a00ce9e014a8695f41a8eef4b38aabdb to your computer and use it in GitHub Desktop.
Auto rotate Script for Unity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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