Skip to content

Instantly share code, notes, and snippets.

@seferciogluecce
Created August 22, 2020 16:18
Show Gist options
  • Save seferciogluecce/c63971170893cdd8d30fddbfc801950d to your computer and use it in GitHub Desktop.
Save seferciogluecce/c63971170893cdd8d30fddbfc801950d to your computer and use it in GitHub Desktop.
Usage tutorial @Devsplorer @ https://youtu.be/qSTv5-FBkL0
using System;
using UnityEngine;
public class Rotater : MonoBehaviour
{
private Transform ToRotate;
private bool RotationStarted = false;
private float Speed = 50.0f;
public Vector3 Axis;
private void Start()
{
// StartRotation(transform);
}
public void StartRotation(Transform TargetT)
{
ToRotate = TargetT;
RotationStarted = true;
}
void Update()
{
if (RotationStarted)
{
//ToRotate.Rotate( ToRotate.up,Speed * Time.deltaTime);
ToRotate.Rotate( Axis,Speed*Time.deltaTime);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment