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
2
Question by vandrewm · Jul 22, 2011 at 02:52 PM · animationspeedwrapmode

Using wrapmode.once and speed cuts animation prematurely

I'm having an issue here with the animation stopping at the point defined in speed. For example, setting the animation speed to 0.5f will make the animation play at half speed, but stop half way through the animation on a "WrapMode.Once" animation. How can I get the animation to play through entirely?

 Animation[Name].speed = 0.5f;
 Animation[Name].wrapMode = WrapMode.Once;
 Animation.CrossFade(Name);
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
3
Best Answer

Answer by almo · Jul 22, 2011 at 03:10 PM

Try WrapMode.ClampForever

Comment
Add comment · Show 4 · 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 JasonM · Nov 22, 2011 at 05:21 PM 0
Share

I had the exact same problem, crossfade always works for looping animations, but if you are crossfading to an animation playing once, Wrap$$anonymous$$ode.Once isn't good enough. ClampForever is the solution. Thanks a million @almo I wouldnt' have found it.

avatar image almo · Nov 22, 2011 at 06:08 PM 0
Share

Sure! Glad it helped.

avatar image sgoodrow · Feb 12, 2014 at 09:10 PM 0
Share

While this does work, it has the unfortunate drawback of the animations never resetting themselves. This means that state.isPlaying will remain true (totally understandably) and that further calls to CrossFade will not replay the animation if it was already playing.

One might think that StopSameLayer or StopAll would stop it, allowing it to be played again, but one would be wrong. :( Any further ideas on how to properly play an animation once at a specified speed?

avatar image UltimateTactix · May 13, 2015 at 08:03 PM 0
Share

I too would be interested in a reset (c#)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I make animations snap to a frame? 1 Answer

How can I get animation state speed in code 1 Answer

Clamp animation to a certain amount of time? 1 Answer

Control animation speed with slider 4 Answers

Set walk animation speed to velocity 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