How to initialize animation?

Hello,

I need to know how to initialize my animation. I know I need to somehow initialize it in my C# script in the start function. Not sure what I’m supposed to put there, though. I tried a couple different things I saw on other forum posts, but none worked for me. I need to know what the standard method of initializing an animation in Unity is.

Side notes (Not sure what all info you need):
-I have a public Animator variable called anim
-My animation is an fbx file imported from Maya
-It plays in the preview screen, so I believe it should work in game once initialized
-Using Unity 5.4.1f1

Thanks for the help in advance!

P.S. Any info on what I’d need to do after initialization to get it rolling would also be helpful :slight_smile:

Hi, you will probably need an animatorcontroller where you actually add the animation.
Using code you can control parameters which might enable or disable the animation(s).

The above is needed when you want to blend your animations.

I have a video on youtube showing how you can animate your models from code in unity.

Hopefully this might help you in the right direction!

Cheers.