Problem with nested Start Coroutine in loop

Hi, this question probably has a simple solution but I cant seem to find it in the Unity documentation or in past problems. Im trying to get a platform to move up 30 spaces along y axis wait 5 seconds, move down 30 spaces along y axis and then repeat this for the duration of the game. For some reason the platform either moves only up, only down or moves up once and then stops. Any help would be greatly appreciated. The code I use has been attached.

You are calling Wait2 without yielding, which means that it will start the coroutine but not wait for it to complete, so it will immediately go to the first WaitForSeconds. And because both coroutines wait 5 seconds, they will execute the transform logic at the same time, resulting in unpredictable behavior.

Change

StartCoroutine (Wait2 ());

To

yield return StartCoroutine (Wait2 ());