Runtime instantiated prefab doesn't animate

I’m trying to make my character instantiate it’s model in runtime (because I have different skins for it).
What I have now is all the code, colliders and animator in a parent gameobject and I’m trying to instantiate the model related to the chosen skin in runtime.

For some reason the model doesn’t animate when I do that.

If I put the same model prefab inside the character and instantiate it as one it works without any problem.

The visual prefab does not have any components on it.


As shown in the image, “Character_WithDefaultSkinModel” works perfectly, but when Instantiating Character_empty and then instantiating “Character_DefaultSkinModel” and setting it’s parent to the Chracter_empty, the model doesn’t animate.


I just realised that acessing the Animator and enabling then disabling the “Apply Root Motion” checkbox the character starts animating again.

It’s like the component needs a reset, does anyone have an idea why? and how to force it properly

I just solved it, all I needed to do was to call Animator.Rebind();

might not be that easy, but you definitely missed a step:

You might just be calling Instantiate() on a gameobject in your scene rather than on a prefab (gameobject in your asset folder).