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 kecaj · Jan 31, 2011 at 02:32 PM · animationstoprewind

ANimation doesn't rewind on animation.Stop

Hi guys. What am I doing wrong? I have a simple Jump animation, runs with Input.KeyCode(Space):

function Update () { if(Input.GetKey(KeyCode.Space)){ animation.Play("JumpAnim1"); } if(Input.GetKeyUp(KeyCode.Space)){ animation.Stop("JumpAnim1"); } }

Scriptin Reference says: "Stopping an animation also Rewinds it to the Start." Animations starts and stops but never rewinds? No matter the wrap mode.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Steffen Franz · Jan 31, 2011 at 07:24 PM

have you tried Animation.Rewind?

Comment
Add comment · Show 1 · 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 kecaj · Jan 31, 2011 at 10:02 PM 0
Share

Yes, but effect is strange. Animation rewinds, plays a while and stops in random frame :(

avatar image
0

Answer by 3DMagicVR · Jan 31, 2011 at 07:25 PM

Hi, You want to play backwards the animation when the character start to fall down to the ground?, if that's the case you must use a function to change the animation.speed from a positive value to a negative value this way you can play an animation backwards.

Try to use a limiter to achieve this animation control if you don't your animation will be in loop, if your are using the loop wrapmode for your animations and don't forget to use the animation.CroosFade() to blend the animations.

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
avatar image
0

Answer by kecaj · Jan 31, 2011 at 10:59 PM

Ok, solution is just simply remove "if(Input.GetKeyUp..." part. Animations finishes playing and stops. It is very short animation so it does no matter it doesn't stop immediately. Most important is that my caracter doesn't freeze in strange pose. Anyway thanks for your answers AngryGerman and 3DMagicVR :)

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

No one has followed this question yet.

Related Questions

Trouble with animation Rewind/stop 0 Answers

Mecanim: Stop/Hold Animation at the end 3 Answers

Animation.Rewind Isn't Working 1 Answer

Making an animation stop once it finishes (trouble with booleans) 1 Answer

Stop animation from playing 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