Search Unity

Animation could not be played because animation could not be found

Discussion in 'Editor & General Support' started by Tiles, Jun 28, 2011.

  1. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Curious problem. I have a character with a few animations. Now i want them to play. But instead of playing the animation i get a warning:

    Code (csharp):
    1. The animation state attack could not be played because it couldn't be found!
    2. Please attach an animation clip with the name 'attack' or call this function only for existing animations.
    3. UnityEngine.Animation:CrossFade(String)
    4. animationlernen:Update() (at C:/Users/x/Documents/New Unity Project/Assets/animationlernen.js:11)
    As told, the animation exists. And i was even able to play it before. I think i got it to play by reimporting the character. So what goes on here?

    I`ve attached the example file. Start the game, press CTRL, and you will get the error.

    While at reducing the problem to just the involved items i get another error now too:

    What does this error mean?
     
  2. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Have it. I made the animation after i have dropped the character into the hierarchy. And so the new made animation at the character in the project tab was not connected with the character in the level. I have dropped the new animation at the character in the hierarchy and the error went away.

    Hm, this is a tough pitfall for beginners like me. Because the animation is nevertheless available here and there. And there is no real hint what to do when a existing animation cannot be found. Well, now that i know ... :)

    Hm, what about a refresh button in the hierarchy so that animated components like a character gets synchronized with the base graphics?