Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jsohndata/4b3fcea945420da0ad0aee89ed0fdd41 to your computer and use it in GitHub Desktop.
Save jsohndata/4b3fcea945420da0ad0aee89ed0fdd41 to your computer and use it in GitHub Desktop.
Rotating Idan: Unity Engine Object Rotating Script

Watch Trailer

About

A simple script to make your object rotate in all 3 axis. Inspired by @Idan, thanks!

Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rotator : MonoBehaviour {
    public float X_Rotation = 10f;
    public float Y_Rotation = 10f;
    public float Z_Rotation = 10f;
    public float ExtraSpeed = 2f;
    
    void Update() {
       transform.Rotate(new Vector3(X_Rotation,Y_Rotation,Z_Rotation) * ExtraSpeed * Time.deltaTime);
    }
}

Panel in Unity

Unity Rotator Panel

YouTube

See the script in action via YouTube.com

Shout Out

AllSky Free - 10 Sky / Skybox Set

Yughues Free Metal Materials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment