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); } }