How to make random spawn of different objects,How to make random spawn of random objects

Hello everyone, I’m making a game similar to Flappy bird. I have already made one type of obstacles, that is, their appearance at a random height. But I would also like to introduce several varieties of these barriers, that is, the periodic appearance of each of their varieties. How to do this, please tell me.

P.S. Below I will attach the code where I registered the random height of the barrier spawn.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class pipe_pawner : MonoBehaviour
{
    public float maxTime = 1;
    private float timer = 0;
    public GameObject pipe;
    public float height;

    void Start()
    {
       GameObject newpipe = Instantiate(pipe);
       newpipe.transform.position = transform.position + new Vector3(0, Random.Range(-height, height), 0);
    }

    void Update()
    {
        if(timer > maxTime) 
        { 
           GameObject newpipe = Instantiate(pipe);
           newpipe.transform.position = transform.position + new Vector3(0, Random.Range(-height, height), 0);
           Destroy(newpipe, 15);
           timer = 0;
        }
        timer += Time.deltaTime;
    }
}

Hello. I think I dont understand what you ask, because seeing your code, you should be able to do what you are asking. Is simple.

You just need to make and aaray or list with all the barriers, and spawn 1 at random.

Pipe[] PipeList;

Instantiate(PipeList[Random.Range(0,PipeList.count-1)]);

If you want something not random, you can always spawn 1 by 1 [0] then [1] then [2]…

This is supposed to be my first game, and I’m making it from guides on the internet, so there’s not much to understand about the code for me. So sorry, I’ll try to figure it out

I have one error:
Error CS1061 ‘GameObject’ does not contain a ‘count’ definition, and could not find an accessible hook method ‘count’ that takes the type ‘GameObject’ as its first argument (capability, missing using directive, or assembly reference).

Can you suggest what to do?