Getting MissingComponentException: Animation not tied to game object

Steps taken:

  • Imported falsified / animated character (fbx file) from Blender (version 2.66a) to Unity (I believe that the version I use is 4.1.2, I know that I downloaded / installed it in the last few days)
  • Checked "Import Animation" in the animation settings in the inspector
  • Created / tested animated clips in the Inspector
  • Dragged a symbol from the Assets panel to the Hierarchy panel

After dragging a character onto the Hierarchy panel, I notice that I no longer see the animation when I select an instance of the character that is in the scene. If I run the game, I get the MissingComponentException indicated in the header.

In general, I can see the animation in the import settings in the Inspector, but as soon as I drag the character into the scene, the animations disappear.

Here is my simple code to reproduce the "idle" animation (which is correctly named and plays correctly in the import settings):

void Start () { animation.Play("Idle"); } 
+4
source share
2 answers

In Unity 4, there are two ways to invoke model animation.

The "classic" way, as in Unity 3: When importing fbx, you must set the "animation type" under "Rig" to "legacy". In Hierachy, a model needs an Animation component, not an Animator component! Then you need to add the animation from your model to the animation component. Now you can write

 animation.Play("Idle"); 

"New" mechanism: When importing fbx, you should set the "animation type" under "Rig" to "generic". In Hierachy, a model needs an Animatior component, not an Animaton component! Then you have to add the animation from your model to the animation controller that you add to the Animator component. In the controller, you can set values ​​to switch between different animations. But if you want to use Mechanim, look at this tutorial, it helped me a lot!

http://www.youtube.com/watch?v=Xx21y9eJq1U

+3
source

In the Import parameter for the object, go to Rig and set the Type animation to Legacy.

+1
source

Source: https://habr.com/ru/post/1479664/


All Articles