Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by fschaar · Jul 02, 2013 at 12:08 PM · buildruntimeresourcesresources.loadasset path

resources not loadable in bulid

We have some resources in a resources folder of our project, which are loaded during runtime (.ogg files and text files which contain some descriptions for the levels). We use Resources.Load, to load these assets. In the Editor everything works fine. But if we make a final build (we tried for Mac, Windows and Android) the level is not build. The reason is obviously that the text files are not loaded. if i look into the log files, it seems, that the program tries to get it from the same folder as in the editor (which doesn't exist in the final build because unity stores the assets in some special files). We are not sure, what we did wrong or how to solve this problem. loading the files during runtime is necessary, because we have about 20 levels with over 1000 audio files. We don't want to assign them in the editor.

We'd appreciate any help!! Thanks!

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lighting · Jul 02, 2013 at 12:19 PM 0
Share

Here similar problem is described. $$anonymous$$aybe this is the case ? http://answers.unity3d.com/questions/168868/how-do-i-include-a-custom-file-in-my-build.html

avatar image fschaar · Jul 02, 2013 at 12:29 PM 0
Share

Yes, but there is no solution that helps me. Seems that the guy imported the files in the editor finally, which is no solution for me as I pointed out in the question. :)

avatar image CHPedersen · Jul 02, 2013 at 01:45 PM 0
Share

Is this for Windows or $$anonymous$$ac? If so, you could just include the needed file with the build (make an Assets/Resources folder next to the executable and put your files here).

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Graham-Dunnett · Jul 02, 2013 at 03:20 PM

Unity has a feature called `Resources`. Add your resources into a folder called Assets/Resources. When the build is made, these assets will be wrapped up into a special file, which you can access using The `Resources.Load` API. Note that this API does not use file paths.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fschaar · Jul 02, 2013 at 06:42 PM 0
Share

that means it doesn't work, if I use subfolders in the resources folder, but will work if everything is plain in one or more "root" - resources folders??

avatar image FatalFlux fschaar · Jan 30, 2017 at 06:12 AM 0
Share

You can have subfolders inside the Resources folder and you would include that subfolder as part of the path when you call Resources.Load(). However, you would not include the file's extension. Like in the Project window in the Editor, Unity ignores the file extension for whatever reason.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Get folder names during runtime within "Resources" package? 1 Answer

Altering prefab at runtime. Works in editor, not in build. 2 Answers

Resources.Load doesn't work at runtime 0 Answers

Distribute terrain in zones 3 Answers

Resources.Load returns null in a build, but works in editor 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges