How to make random obstacles and move it along the platform??

For me the platform is moving…But the instantiated obstacles are not moving!Please help

Platform:
    [SerializeField] float objSpeed = 1;
    [SerializeField] private float startPos;
    [SerializeField] private float resetPos;
    // Use this for initialization
    void Start()
    {
    }
    // Update is called once per frame
    public void FixedUpdate ()
    {
        transform.Translate(Vector3.back * (objSpeed * Time.deltaTime));
        if (transform.localPosition.z <= resetPos)
        {
            Vector3 newPos = new Vector3(transform.position.x, transform.position.y, startPos);
            transform.position = newPos;
        }
    }
}

Obstacle:

void Start ()
    {
        StartCoroutine(WaitSpawner());
    }
    IEnumerator WaitSpawner()
    {
        yield return new WaitForSeconds(startWait);
        while (!stop)
        {
            ranVar = Random.Range(0, 2);
            if (ranVar == 0)
            {
                Vector3 spawnPos = new Vector3(obsPos[ranVar].x, obsPos[ranVar].y, Random.Range(1.5f, 2.5f));
                obj = Instantiate(obstacle, spawnPos, obstacle.transform.rotation) as GameObject;
                obj.transform.Translate(Vector3.back * (objSpeedd * Time.deltaTime));
                Destroy(obj, 5f);
                yield return new WaitForSeconds(spawnWait);
            }
            else
            {
                Vector3 spawnPos = new Vector3(obsPos[ranVar].x, obsPos[ranVar].y, Random.Range(1.5f, 2.5f));
                obj = Instantiate(obstacle, spawnPos, obstacle.transform.rotation) as GameObject;
                obj.transform.Translate(Vector3.back * (objSpeedd * Time.deltaTime));
                Destroy(obj, 5f);
                yield return new WaitForSeconds(spawnWait);
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        spawnWait = Random.Range(spawnLeastWait, spawnMaxWait);
    }

Thanks dude

get rid of lines 15 and 23 in the second script and just make the instantiated obstacles children of the platform

you’ll then need to clear the “old” obstacles from the platform when you reset it.

might be of interest: Beginner Scripting - Unity Learn

instantiated obstacles children of the platform?This is my question bro!