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 ShinyTaco · May 16, 2013 at 12:13 AM · animationplaycrossfadereversebackwards

Why is Animation Not Playing in Reverse?

Not sure what I'm doing wrong here. I have this code in a function, when it's called I would like this animation to play backwards at twice the speed of normal.

Here's my code:

         animation["playAnimationPlease"].layer=10;
         animation["playAnimationPlease"].wrapMode = WrapMode.Once;
         animation["playAnimationPlease"].speed=-2;
         animation.CrossFade("playAnimationPlease");

I can verify that the function gets called, and it does but the animation doesn't play.

Any ideas?

Thanks!

Comment
Add comment
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

2 Replies

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

Answer by ByteSheep · May 16, 2013 at 12:19 AM

As this forum post shows, you need to set the animation time to the end of the animation clip before playing it:

 animation["playAnimationPlease"].layer=10;
 animation["playAnimationPlease"].wrapMode = WrapMode.Once;
 animation["playAnimationPlease"].speed=-2;
 animation["playAnimationPlease"].time = animation["playAnimationPlease"].length;
 animation.CrossFade("playAnimationPlease");

Please always do a google search before posting here to make sure the question hasn't already been answered.

Comment
Add comment · Show 6 · 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 ShinyTaco · May 16, 2013 at 12:23 AM 0
Share

Thanks, I've done a lot of Google Searching and still have not found what I'm doing wrong.

avatar image ByteSheep · May 16, 2013 at 12:25 AM 0
Share

Google Search

avatar image ShinyTaco · May 16, 2013 at 12:31 AM 0
Share

Yeah, I've tried those. It doesn't work.

avatar image ByteSheep · May 16, 2013 at 12:34 AM 0
Share

Have you already tested it with the added line

 animation["playAnimationPlease"].time = animation["playAnimationPlease"].length;
avatar image ByteSheep · May 16, 2013 at 12:47 AM 1
Share

Here is a working example using exactly the code in my answer..

reverse animation.zip (105.9 kB)
Show more comments
avatar image
0

Answer by ShinyTaco · May 16, 2013 at 01:00 AM

Thank you. Yes, I saw that post, it was my error. Apologies for beating a dead horse.

Comment
Add comment · 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

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

14 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

Related Questions

Help With Animation Play Back - Reverse 1 Answer

[Unsolved] Playing animation backwords [Unsolved] 1 Answer

Playing several animations 1 Answer

Set up Animator with specific seconds 1 Answer

Button to play animation in reverse 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