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 bobatismo · Jul 01, 2014 at 08:27 AM · animationienumeratorspritesheet

Animation won't play after marked as legacy

Hi. I created an animation using a sprite sheet. It's a "puff of smoke" that plays during a teleport. The script does a yieldforseconds that gets the length of the animation.

yield return new WaitForSeconds(animation["EyeTeleport"].length);

My problem is that if I leave the animation as it is (not legacy), the animation plays properly but my script breaks on a nullexception/getref error in an IEnumerator function. In other words, the puff of smoke happens, but the object does not teleport.

Since the editor is saying "mark it legacy", I do so. And now the script works perfectly. The object teleports after the right amount of time. However, the animation will not play.

Obviously, I would like both things to work, and I am hoping someone can help me get this figured out. Thanks!

Comment
Add comment · Show 4
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 Klarax · Jul 01, 2014 at 08:50 AM 0
Share

im not to sure about this, but i always thought that animations are either one or the other. and are exported as such, so if its legacy then it requires animation to be legacy and visa versa. so switching wont work.

$$anonymous$$aybe someone more experienced in animation can answer, cos maybe my knowledge is wrong :)

avatar image HarshadK · Jul 01, 2014 at 10:47 AM 0
Share

Could you post the script you are using? and also the inspector screenshot for animation?

avatar image bobatismo · Jul 01, 2014 at 08:17 PM 0
Share

Definitely! :) Thanks for the offers of help! :)

Here is a link to a video of the game in action: http://youtu.be/9X5TIjHC97w

And here is my teleport code. It should be clear since my scripting skills aren't very advanced, but... I find any game object tagged Target1, and then check what level is active. If it's level 5, then I set bAnimatingEye to true (so that the player cannot move while the "goal" is moving. I then play the animation for the puff of smoke, wait until it's done, teleport the eye, then play another puff of smoke to hide the pop-in.

     IEnumerator $$anonymous$$akeTheEye$$anonymous$$ove()
     {    
         if (gameObject.tag == "Target1")
         {
             LineTest CheckLOS = (LineTest)Target.GetComponent(typeof(LineTest));
             if (LineTest.sCurrentLevel == "Puzzle_Level05")
             {
                 bAnimatingEye = true;
                 CheckLOS.LineOfSight();
                 anim.Play("EyeTeleport");
                 yield return new WaitForSeconds(animation["EyeTeleport"].length);
                 EyeLocation.position = new Vector3(-10.5f, 12.55f, -10f);
                 anim.Play("EyeTeleport");
                 yield return new WaitForSeconds(animation["EyeTeleport"].length);
                 bAnimatingEye = false;
                 LineTest.iSeeYou--;
                 CheckLOS.LineOfSight();
                 
             }
         }
         else{}
     }
 

FRAPs would not record my entire desktop, but in the Animator window, you can see that my EyeIdle clip is playing (it's a blank clip). When the eye is teleporting, it shows that the EyeTeleport clip IS playing. However, as you can tell by the clip, you can't SEE anything happening. Nothing appears in the console at all. It's blank throughout.

And here's a screenshot of my inspector for the animation:

alt text

And here's a screenshot of my animator/animation windows:

alt text

If I can provide anything else to make this clear, let me know! :)

avatar image Minay · Jul 23, 2014 at 02:29 AM 0
Share

Did you solve it?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can I make animations snap to a frame? 1 Answer

Animation frames are jittery 2 Answers

Replace Sprite Sheet that's Already Animted? 0 Answers

Performance question - Animations in spritesheet vs animation in Mecanim? 0 Answers

Performance question 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