Search Unity

Resources folder confusion

Discussion in 'Editor & General Support' started by eco_bach, Sep 6, 2019.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    I'm creating a desktop application.
    If you're simply instantiating a prefab at runtime, do you need to put it in a 'Resources' folder in your project, or can it be put anywhere in your Assets directory?
    Confused about the uses of the Resources folder...
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,203
    The Resources folder has only one purpose and that is to force an asset to always be included in a build. Just about every other folder is completely valid for storing assets. You don't need to do anything with Resources unless you need an asset to be included because the build process would otherwise not include it (eg only a script referencing it).

    https://docs.unity3d.com/Manual/SpecialFolders.html
     
    Joe-Censored likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I believe a second purpose of Resources is so you can keep those assets available for use in any scene while not having to load them into memory before actually needed, in comparison to a reference to an asset which will load it into memory on scene load. (Though I believe all assets in Resources folders are limited to 4GB total size just like an individual scene, so not as useful for giant projects as one might initially assume)