- Home /
AssetBundle.LoadMainAssetAtPath not loading .meta files
Hi friends,
I am currently building an asset bundle. The list of files is retrieved from Directory.GetFiles method. This is also returning .meta files.
So I am trying to load all assets in a directory. When a meta file is encountered it giving an exception that Unable to load the asset at .
Based on the errors I have these questions.
When I export an asset as a bundle do I need to export .meta files also?
Or will Unity automatically include those?
Answer by dorpeleg · Feb 26, 2015 at 09:46 AM
You are not meant to load .meta files. There is no reason to put the meta files in the bundle.
What you need to do is:
Once you have the array of file paths, loop them and remove any path that contains "meta".
Then use the cleaned array to create the bundles.
I already did. But I was not sure whether I need to cnclude .meta files also in the bundle. Thanks.
"There is no reason to put the meta files in the bundle." - Yes there is. Some version control systems write identifiers in meta files. And maybe you are also making manual changes to the meta files like setting useFileScale: 0
which is the only way to get around faulty mesh scaling co$$anonymous$$g from 3D modelling software. (since useFileScale
is a bool not accessible through code through the AssetPostProcessor (or pre-processor)). Of course if you're downloading the bundles at runtime, unity would not have bothered to read those meta files even if they were somehow included.
Your answer
![](https://koobas.hobune.stream/wayback/20220613184354im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
BuildOptions.BuildAdditionalStreamedScenes work with players other than webplayer? 1 Answer
how can i put components in external dlls and store dlls in asset bundles 4 Answers
Are AssetBundles a solid solution for providing in-app purchasses in my app ? 1 Answer
Memory leak using bundles. 1 Answer