Problem building AssetBundle

Hi,

I have some problem getting the BuildPipline.BuildAssetBundle command to work.
I have a folder (Assets/Chapter1) that contains 4 *.fbx-files and I want to make a assetbundle of these files.

This is my command:
BuildPipeline.BuildAssetBundle(null, AssetDatabase.LoadAllAssetsAtPath(“Assets/Chapter1/”), “testchapter.unity3d”, options);

But that don’t seems to work.

If i change to command to:
BuildPipeline.BuildAssetBundle(null, AssetDatabase.LoadAllAssetsAtPath(“Assets/Chapter1/Sphere.fbx”), “testchapter.unity3d”, options);

Then it’s working, but of course only with the file that I’ve specified.

Is there a syntax problem with my BuildPipeline command or is it a bug?

Best Regards,
Zarillo

Try specifying your chapter scene, instead of an fbx.
If you really only have an fbx and no scene, what you could do is make a prefab that references your other fbx’s and then create an assetbundle out of that.

I think you should also be able to pass your four fbx’s as object[ ] for the second parameter, allthough it must be said that the api for this defenitely is not as clear as it could be. There is a reference projectfolder available though, which I highly recommend looking at if you’re doing anything with assetbundles:

http://unity3d.com/support/resources/example-projects/assetbundles

Thx for your suggestions Lucas. I’ve been looking at the example-project that you mentioned, but I don’t get any wiser. It so strange that you can load a specific file but not all the files. I’ve also tried to create an arrey of objects and use that as a inparameter in the BuildPipeline function, but I can’t get that to work either.

I have managed to load the entier scene, as they do in the example, but it’s now quite what I’m trying to accomplish.

I’m makeing a mediaplayer (with animations) and all I want to load from the assetbundle is the animations (Maybe this could be done with the BuildPipeline.BuildPlayer too).

I’ve also sent a mail to support but they can’t help me either :frowning: