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.

  1. When I export an asset as a bundle do I need to export .meta files also?
  2. Or will Unity automatically include those?

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.