holopy3/Assets/Scripts/LightRotation.cs

31 lines
723 B
C#
Raw Permalink Normal View History

2020-12-10 14:25:12 +00:00
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);
}
}