Firstborn/Assets/Scripts/SpinVert.cs
Schaken-Mods d2c5e0c92c Update 4/25/23
Worked on the Editor's Actor creator. NPC's can now have custom colored skins and hairs.
2023-04-26 00:28:58 -05:00

35 lines
907 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpinVert : MonoBehaviour
{
[Header("Spin on axis")]
[SerializeField] public bool X = false;
[SerializeField] public bool Y = false;
[SerializeField] public bool Z = false;
[Header("Controller")]
[SerializeField] public bool Spin = false;
[SerializeField] private float Speed = 100f;
// Update is called once per frame
void Update()
{
if (Spin) {
if (X) {
transform.Rotate(Speed * Time.deltaTime, 0f, 0f, Space.Self);
}
if (Y) {
transform.Rotate(0f, Speed * Time.deltaTime, 0f, Space.Self);
}
if (Z) {
transform.Rotate(0f, 0f, Speed * Time.deltaTime, Space.Self);
}
}
}
public void StartSpinning() {
Spin = true;
}
}