Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Scej · Aug 18, 2016 at 02:03 PM · animationanimator controllerspeed

Need help playing animation in reverse

So I'm building a very intricate machine model that has thousands of animated parts the user can activate.

Each part only has one animation, "take off" or "open" which is pretty simple. I can get the animation to play in one direction "take off" with this

animator.Play("part351animation");

but I can't for the life of me figure out how to get it to play in reverse.

I've tried animator.speed = -1f; but it just spits out console errors about the recorder not being enabled.

I can manually set the speed on the animation via the inspector but I can't figure out how to access that property via code to switch between 1f and -1f.

I've also tried animator.SetFloat("Speed" -1f); but it says that paramater does not exist. I know I could manually use the mechanim to create different states but with thousands of parts it would take me ages for something that seems like it should be simple.

In a perfect world I see it being animator.Play("part351animation", -1f); where -1f is speed.

I'd like a code solution that I can put into place without having to reimport all of my animations differently or setting them as legacy.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by PhantomSarcasm · Aug 18, 2016 at 03:26 PM

if not getting the parameter in the animator. if it says that the speed parameter is that there is not as created and to make the animation work to a floating vase have to make it multiply in the inspector. alt text


datos.png (47.4 kB)
Comment
Add comment · 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 Scej · Aug 18, 2016 at 03:46 PM 0
Share

This works but only as a workaround, it would mean that I still have to go back and manually change thousands of animations and if I started a new project I would have to change thousands more.

Thank you for your answer though.

avatar image PhantomSarcasm Scej · Aug 18, 2016 at 04:08 PM 0
Share

I do not know if there is any way to return all the animation with a single command, but it is the most viable. you could use Time.TimeScale = -1;

to make it back off everything but is not very profitable for receding all ... Like good eh not always use tried the code "0" or "1" to stop and move again as sort of pause

avatar image Scej PhantomSarcasm · Aug 18, 2016 at 05:46 PM 0
Share

I can't believe Unity doesn't expose this with the Animator, with legacy animations its easy. I guess it's because people wanting to automate their animations strictly from code are the $$anonymous$$ority.

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

110 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 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 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 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 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

Passing speed and direction to an Animator Controller 0 Answers

Animator stops working after updating to 5.6 3 Answers

Wait for animation to finish and do something 1 Answer

AnimationEvent has no receiver, but there is no AnimationEvent 1 Answer

Animator and Scripting problems. Help !! 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