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
0
Question by Jeffrachov · Mar 12, 2013 at 11:47 AM · animationnullreferenceexceptionspeedevent

Animations couldn't be found but still plays

Ok so i have this problems with animations. The animations are done with mocap and imported. They do work and i can get them playing like they should but, and its a big but, i get this error when i play them: "The animation state Block_Mid_01_copy could not be played because it couldn't be found! Please attach an animation clip with the name 'Block_Mid_01_copy' or call this function only for existing animations." I use CrossFade to play the animation and it plays just like they should only i get that error. Now that may not be a big problem but i have another animation i have a event in and it gives me a NullRefernceException when i try to use that animation in a script. But its a bit more strange than that... the function called works when the animation reaches that event but wont work when i call it after that. I have used a script i found here to copy the animation to be able to place events in it. I get the error for ALL imported animations tho, not just the copied one. What im trying to do is in a fighting game i have a block animation. The animation is made in such a way that the model raises its arms and then drops them. What i do with the event is to set the speed of the animation to 0 and then i have a input check for when someone releases that button and set the speed to 1 again. The first part works just as it should (it pauses in block mode) but the second part (where i set the speed to 1 again) refuses to work. Code: Function that is called by the event.

 function blockSpeed(speed : float){
     if(animation["Block_Mid_01_copy"] == null){
         Debug.Log("wtf");
     }
     animation["Block_Mid_01_copy"].speed = speed;
 }

(the first if is actually true and i get a "wtf" in the log... even when the animation speed is set to 0 when the event is reached in the animation) Button up check:

 if(Input.GetButtonUp("Block")){
         blockSpeed(1);
 }

I tried a check to see if the animation is actually existing with a simple check if the animation[x] == null and it IS null... but still playing. Can you play a animation that does not have a clip? Thats the only thing i can think of but it sounds crazy and i have no clue how to solve this problem if that is it.

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 Jeffrachov · Mar 12, 2013 at 04:40 PM 0
Share

ok so i switched to c# and it worked... but then i couldnt call a method from the animation event. I finally made that event in code ins$$anonymous$$d of via the animation editor and it worked. If anyone knows how to get the editor thingy to actually call methods in c# i would like to know.

0 Replies

· Add your reply
  • Sort: 

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

10 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

Related Questions

Animation control using Events and .enable 1 Answer

Speed button for animations? 2 Answers

Material transition through animation 3 Answers

Animation Event issue what am I doing wrong here 2 Answers

how do you add an event to an imported animation 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