mirror of
https://github.com/nothke/quality-control.git
synced 2024-12-22 15:57:28 +00:00
17 lines
404 B
C#
17 lines
404 B
C#
using UnityEngine;
|
|
|
|
public class ConstantRotation: MonoBehaviour
|
|
{
|
|
public Vector3 Axis = Vector3.up;
|
|
|
|
public float RotationRate = 1f;
|
|
|
|
public void Update()
|
|
{
|
|
var rotation = transform.rotation;
|
|
|
|
var delta = Quaternion.AngleAxis(RotationRate * Time.deltaTime, Axis);
|
|
|
|
transform.SetPositionAndRotation(transform.position, rotation * delta);
|
|
}
|
|
} |