How to get List of Rigidbody from List of GameObjects?

I can’t figure out the logic of why this isn’t working?
I can get this working with a fixed array, but this same isn’t working for lists.

I’ve generated my list of GameObjects:

        for (int i = 0; i < poolAmount; i++)
        {
            int randomIndex = Random.Range(0, objects.Length);
            GameObject obj = (GameObject)Instantiate(objects[randomIndex]);
            obj.SetActive(false);
            pool.Add(obj);
        }

I’ve tried a few methods in different orders, and I thought the GetComponent way would work, but I’m obviously missing something here:

        for (int i = 0; i < poolAmount; i++)
        {
           rb.Add(pool[i].GetComponent<Rigidbody>());

or
            rb.Add((Rigidbody)pool[i].GetComponent<Rigidbody>());

or

          Rigidbody rbobj = pool[i].GetComponent<Rigidbody>();
          rb.Add(rbobj);

        }

And a foreach after the pool objects are populated:

        foreach (GameObject poolObjects in pool)
        {

            if (poolObjects.gameObject.activeSelf)
            {
                rb2 = poolObjects.GetComponent<Rigidbody>();
                rb.Add(rb2);
            }
        }

The first method populating the list with the correct amount of entries, and foreach does it as the pool is made active, but they’re all null in both cases.

This lists the correct rigidbody in an Update statement:

        for (int i = 0; i < pool.Count; i++)
        {
            Rigidbody rbrb = pool[i].GetComponent<Rigidbody>();
            Debug.Log(rbrb);
        }

It should just be a case of getting any component on the gameobject - I know I’m missed something stupid, but I’m stumped.

OK ignore me, I was setting

            obj.SetActive(false);

And it wasn’t finding a Rigidbody on it. I just ran a seperate routine and SetActive in that. :wink:

        for (int i = 0; i < pool.Count; i++)
        {
            Rigidbody rbrb = pool[i].GetComponent<Rigidbody>();
            //Debug.Log(rbrb);
            rb.Add(rbrb);
            pool[i].SetActive(false);
        }