Instanciate gameobject from Resources subfolder

Hi!

I have two prefabs with the same name in the resources folder and I want to instantiate them with the same variable in my script but from two different subfolders in the resources folder so the game can see they are different. How do I do that?

Just specify the folder in the resource name when loading…

GameObject go1 = Resources.Load("Folder1/Prefab");
GameObject go2 = Resources.Load("Folder2/Prefab");

The resources folder would look like this:

Resources
  Folder1
    Prefab
  Folder2
    Prefab