holopy3/Assets/Scripts/LightRotation.cs
2020-12-10 15:25:12 +01:00

30 lines
723 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LightRotation : MonoBehaviour
{
// unfertiges Script, keinen Bock mehr drauf gerade
public float LightSpeed;
private float yValue;
private float timeCounter;
// Start is called before the first frame update
void Start()
{
timeCounter = 0;
yValue = transform.rotation.y;
}
// Update is called once per frame
void Update()
{
timeCounter += Time.deltaTime;
float y = Mathf.Cos(timeCounter);
print(y);
gameObject.transform.rotation=new Quaternion(transform.rotation.x, y, transform.rotation.z, transform.rotation.w);
}
}