Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Giantbean · Jun 04, 2014 at 11:10 PM · animationanimationclipattached

How do you properly attach Animation clips?

I have not worked with unity in a while (and I have never animated in it before) and now I am getting an error that has wasted a full day of work.

"The animation state X could not be played because it couldn't be found! Please attach an animation clip with the name 'X' or call this function only for existing animations."

All the online info I can find basically just says attach the animation to the game object and/or switch the rig to legacy. Research links (1), (2), (3), (4) and more.

Now, as far as I can tell my animation is attached (see image↓) alt text

My rig is set to legacy and the top level game object has no imported animation in the Inspector, however this is expected as I am animating inside Unity rather then importing .fbx animation I have tried this as a prefab and without. The animation is on a single part (or parts) of the model. Will animation not work if it is on sub/grouped objects of the master FBX model?

I have an animation on a switch/Knob, when clicked it should animate to the off position and a blinking light stops blinking as well as turning off another light. Currently the switch loops back and forth between the off and on position and all the lights blink in an endless loop even with loop time unchecked. I can not find any good tutorials for animation in 4.1.3. The best I video tutorial have found was for an older version.

What am I doing wrong? How do you animate and que the animation to play clip by clip with C#? Why is my animation not showing up as attached? Any help would be greatly appreciated.

animationerror.jpg (374.4 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Giantbean · Jun 05, 2014 at 04:11 PM 0
Share

Here is a link to another person with a similar issue.

Is this a bug? has it been fixed in later versions?

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Lazdude17 · Jun 05, 2014 at 05:48 PM

I haven't put an animation directly on my object so I don't know how that works, but you could use the Animator to do all this for you.

http://unity3d.com/learn/tutorials/modules/beginner/animation

^Unity's official tutorials on the subject. May help.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Giantbean · Jun 05, 2014 at 05:55 PM 0
Share

Thanks I will look at those I had found docs but not videos. Thank you so much.

I have an animation and an animator on the object as you can see in my image above. I tested on a friend using 4.5 and he did not get the same error message I am seeing. I would update to 4.5 but I am behind a fire wall and the IT process is lengthy. However if watching the vid's fails to help me I may be left with no other choice. Thanks again.

avatar image Lazdude17 · Jun 05, 2014 at 06:00 PM 0
Share

No problem. Just comment again if you need help. I'm using 4.3 and this works just fine for me. First just take the animation clip off of your object then the videos should explain the rest. Good luck ;)

avatar image Giantbean · Jun 05, 2014 at 06:55 PM 0
Share

O $$anonymous$$ i watched these and they are the same thing that the Documentation has. Its nice to watch ins$$anonymous$$d of read and get a visual but its nothing new and I am still stuck.

The one thing I noticed in a view of the videos is that his animation showed the model while $$anonymous$$e just shows a white arrow in a gray box. So my animation it seems is not attaching to the model but I still don't know how to make it attach.

As a test try making a simple sphere or cube. Click "Add Component" > "miscellaneous" and add an "animation" open the animation window (ctrl+6) and select "Add Curve". Name it something like bounce.anim Then select transform and the "+" next to position. Set a key at 0 and 1: then set a key at :30 and move the object down. record the animation. and hit play. The object will bounce up and down on screen. Turn off loop Time and it will only bounce once. Now make a code to make the animation play on a key code

 using UnityEngine;
 using System.Collections;
 
 public class TestAnimation : $$anonymous$$onoBehaviour {
 
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
         if(Input.Get$$anonymous$$ey($$anonymous$$eyCode.LeftShift)){
             animation.Play("bounce");
         }    
     }
 }

and when the key is selected that's when I get the error?

I see posts about warp mode but all I see is loop time?

avatar image Giantbean · Jun 05, 2014 at 07:21 PM 0
Share

With the answer below ↓↓↓ I see warp mode!

avatar image Giantbean · Jun 09, 2014 at 03:29 PM 0
Share

So I have been testing and I think I may have a solution. I hope it helps others.

The order things are added in is very important. The documentation and the videos do not make it very clear but if you are adding an animation, you need to make sure you add the animation component (animation not animator!) to the object before you click add curves. If you select the model and hit add curves it will add an Animator component not the animation component and then you will have both as is seen in my screen grab in the above question. When this happens the animator will not be attached and your scripts will throw errors.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to play an Animation only once from my MachineState Animator? 2 Answers

EDITOR: How to Change Animation Curve Colors 0 Answers

Animator Controller 2D RPG Best Practices 0 Answers

Simple state switching to mouse over & pressed requires 2 animation clips with some parts duplicated? 1 Answer

AnimationClip in local coordinates 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges