transform.Rotate to -30 and then to +30 degrees in loop every 8 seconds

This is the line of code, which rotates my bubbles in a random direction [as i dont want all of them to rotate in same direction at same speed].

gameObject.transform.Rotate(Vector3.up*Random.Range(-0.6f,0.8f));

Now how can i make them kind of oscillate from -30 to +30 in 8 seconds in a loop and if i can random range angles too then it can be much better

Thank you for helping me

Try using a coroutine with WaitForSeconds.

Take a look at the docs Unity - Scripting API: WaitForSeconds

You could probably set a bool and every 8 seconds you change it? I’m really not sure.