- Home /
AnimationClip in AssetBundle can't load correctly
Hi everybody, I want build AnimationClip to AssetBundle, then I can dynamic use the AnimationClip when I load AssetBundle. but when I loading AnimationClip after build the AssetBundle, I can get the AnimationClip object, but the internal data in the object is wrong, and my character can't play it.
if I build other resource like AudioClip in AssetBundle, I can use it perfect. is humanoid AnimationClip can't build in AssetBundle or someting i used in wrong way? :(
Does Unity can build Mecanim AnimationClip into AssetBundle or not?
detail: 1. I use Mecanim Animation System. AnimationType is humanoid. 2. I get AnimationClip(.anim file) from FBX, use Ctrl+D seperate the AnimationClip. 3. if I place the AnimationClip in Resouces folder, I can use Resources.Load load correctly, but if build in AssetBundle it won't works. 4. My Unity3d version is 4.5.5f1
build code: BuildPipeline.BuildAssetBundle( null, kvp.Value.ToArray(), path, BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.CollectDependencies, BuildTarget.StandaloneWindows );
load code: byte[] binary = use System.IO read Asetbundle; AssetBundle ab = AssetBundle.CreateFromMemoryImmediate( binary ); if( ab != null ) { if( ab.Contains( name ) ) { Object asset = ab.Load (name, typeof(AnimationClip)); return asset as AnimationClip; } }
need you help, thank you everybody!