• 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
Question by Dainiusss · Feb 12, 2015 at 03:29 PM · animation2dspriteplayreverse

How to play an animation in reverse?

Hello! I wanted to ask, how can I play an animation in reverse in my animator? When my object is on the ground, it's doing idle animation, when it starts flying, it does animation1 without looping (to change children sprites positions). When it does the transition from idle to animation1, it does it perfectly, but when it does it in reverse (to go back to idle), it ignores all keyframes and curves and just moves all sprites to the idle position (it does not change them instantly, it just ignores keyframes and curves, goes in straight line). So, how can I play my animation in reverse? Is there a way to do it without code, maybe?

Comment
jethrogillgren

People who like this

1 Show 0
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

1 Reply

  • Sort: 
avatar image

Answer by smoggach · Feb 12, 2015 at 04:02 PM

Set the time Speed of the mecanim state to -1 and it will play reversed.

Comment
Dainiusss
$$anonymous$$
jethrogillgren

People who like this

3 Show 3 · 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 Dainiusss · Feb 12, 2015 at 06:15 PM 0
Share

Yeah, but if I set my animation speed to -1, my animation does not even start when it should, I need an animation to be reversed only when back transition is made. Should I do that by code? Thanks

avatar image smoggach · Feb 12, 2015 at 06:20 PM 1
Share

Very hard to understand your english. Here is an example of what I mean:

State 1: Motion: your_animation Speed: 1

State 2: Motion: your_animation Speed: -1

If you've already got it that way then the problem is probably in your transition to the reversed anim. It's not really ignoring your curves it's blending them because the transition takes the entire length of the animation.

avatar image Dainiusss · Feb 12, 2015 at 06:36 PM 2
Share

Ok, now I got it. I did it in that way... I don't know if there is a smarter way, but anyways, this works:

alt text

Thank you very much for your help and sorry for my bad english, I am sleepy today and have a headache...

controller.png (10.9 kB)

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

How to have the sprite in animation move side to side 1 Answer

Recoloring animated sprites [Solved] 2 Answers

Animation doesn't play all the way through unless holding the key down 1 Answer

Spritesheet bigger than 2048? 0 Answers

How to show two 2D animations at the same time? 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