Animator doesn't work on prefab after loading from Asset Bundle
I have an assetbundle that loads a prefab. The prefab has a few timelines, an animator on the gameobject that animates, etc.
When I load the asset and instantiate it, the object doesn't animate (although sometimes it will but without a reason). I have placed code to check if there is an animator, if not then add it, check if the gameobject to animate is assigned to the animator, if not then add it, and check if the avatar is connected, and add that too if missing. None of it helps. The object is still instantiating in a pose that is frozen with no animations.
In unity, it works fine. The prefab instantiates and plays it's idle animation. This doesn't happen when I run it on my Android in Augmented Reality (but like I said above, sometimes it doesn't on random builds for reasons I can't pinpoint).
Does anyone have any ideas?
Answer by MaryamKamel · Jul 28, 2020 at 04:40 PM
@jipsen head to player settings > other settings> uncheck strip Engine code , this should get all animations to work
Thanks! I will try that if I attempt it again. I switched to using addressables instead which are REALLY NIC$$anonymous$$
@jipsen Hey! Were you able to solve this problem in some way? I'm having the same exact issue. The fact that it works sometimes and not other times is super weird and right now I'm quite stumped on this... Unchecking strip engine code didn't make a difference for me.
No. I got too frustrated trying to figure it out that I changed my project over to addressables instead. Addressables are insanely better than asset bundles and I have not encountered this or any other issues with them.
Woah, thanks for the super quick reply :D Alright I will definitely read up upon addressables in that case :)
Your answer
Follow this Question
Related Questions
Animation and Timeline Not Working,Animation and timeline errors 0 Answers
Timeline and morphing done in 3D max and other programs, Help! 0 Answers
AnimationClip length always equal 1 when prefeb is loaded from assetbundle with Unity5.3.2p1 1 Answer
Animations are not playing when prefebs are loaded using asset bundle in Unity 5.3 1 Answer