[easy] Resource Loading

Hi,

I can’t seem to load any resource from my Resources (shame on me)

This is my folder Architecture :

Project/Assets/Resources/test.png

And this is my code :

  void Start () {
  Object tex = Resources.Load("test.png");
  if (tex == null) Debug.Log("load failed");
  renderer.material.mainTexture = (Texture2D)tex;
   }

Resulting in both build and editor mode with a “load failed” in the console and the texture of my objects material not changing.

Where did I get wrong ?

thanks for reading

No file extension on Resources.Load. Do Resources.Load(“test”);

I’ve just seen that…

Thank you very much for the answer anyway :slight_smile: