unity rotate sine code example
Example: unity rotate sine
public float speed = 2f; public float maxRotation = 45f; void Update() { transform.rotation = Quaternion.Euler(maxRotation * Mathf.Sin(Time.time * speed), 0f, 0f); }