Load All doesn't work to load all textures from folder. SOLVED

I am pooling my objects and want to each object to have a new random texture from textures folder, a prefab has a sprite renderer on it and here is my code

 Texture2D texture;
    private Object[] textures;

    void Start () {
         textures = Resources.LoadAll("Textures", typeof(Texture2D));
        InvokeRepeating("Create", hTime, hTime);
	}

    void Create()
    {
        GameObject obj = Pooler.current.GetPooledObject();
        if (obj == null) return;
        texture = (Texture2D)textures[Random.Range(0, textures.Length)];
        obj.GetComponent<Renderer>().material.mainTexture = texture;
        obj.transform.position = pos.position;
        obj.transform.rotation = transform.rotation;
        obj.SetActive(true);
        
    }
}

However it doesn’t work despite of the right hierarchy of my folders.

First of all Resources.LoadAll has a generic implementation and you should use it. This would turn your code into

private Texture2D[] textures;

void Start ()
{
    textures = Resources.LoadAll<Texture2D>("Textures");

However your current code should actually work just fine. Are you sure your “Textures” folder actually is located in the “Resources” folder? Resources.Load / LoadAll can only load assets from Resources folders. Make sure you read this page carefully

Keep in mind that every asset you put in a resources folder will alway be included in your build, if you use it or not. So use the Resources folder with care.