Objects move down from top of screen,I want objects to randomly spawn at the top

hey guys i need help with something.
I want object to spawn at random positions at the top of the screen and move down to the bottom but sometimes randomly change lanes instead of going down in one direction. ,Hey guys I need help with something…
I want different objects to spawn at the top of the screen and move towards the bottom of the screen and randomly change directions instead of moving straight down.

use Random.Range to generate random numbers, you can use them for spawn locations and for moving too. you can make a random number from -1 to 1 so -1 makes it go left down, 0 straight down, 1 right down. or whatever you need.

So basically like…

public GameObject CubeToSpawn;
int RandomX;

void Update()
{
     GameObject spawnedCube = Instantiate(CubeToSpawn, new Vector3(RandomX, 6, 0), Quaternion.identity);
     StartCoroutine(Delay());
}

IEnumerator Delay()
{
     yield return new WaitForSeconds(1);
}