Animated character appears in T Pose in its first frame

Hi,

I create my character by loading a model like this:

m_GameObject = GameObject.Instantiate(Resources.Load("fbx/CharacterName"));

and then immediately I set the active animation using

m_GameObject.animation.Play("AnimName");

Note that this happens during the MonoBehaviour.Update().

For the first frame, this character shows in T-pose and then it starts playing the animation I requested.

Any idea on how to solve this problem? Thanks!

Do you have multiple animations stored in one file or did you import them separately? Do you have the T pose set as an idle animation somewhere? Without seeing your project all I can imagine is that something isn't letting the animation you want play right away and the T pose is what you see until it's allowed to play.

I know I have a lot of code controlling when certain animations can play, check that, maybe the problem is there.

Sorry I didn't mean to write here, I had the wrong question opened..

There's no other code controlling the character animation - only what was shown above. The character is exported in T pose, and the first frame of the first animation clip is the T-pose. However, as soon as I load up the character, I'm playing the animation - as illustrated.

I would set which animation the object should start in the Awake() function. This way you can set up the initial state of the object even before the first update of it.