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 Persona · Sep 09, 2011 at 12:58 AM · animationjavascripterrorplaycrossfade

Animation Crossfade won't play but Animation Play does

Hi,

I have an animation that I need to play with animation.Crossfade for transitional sake but it doesn't work, only playing two or three frames before stopping. When set up as animation.Play it works fine but the animation transition is unacceptable.

Does anyone know the reason for this and a solution?

Comment
Add comment · Show 4
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 Owen-Reynolds · Sep 09, 2011 at 02:13 AM 0
Share

How long is the animation? crossFade, if you don't say, takes 3/10ths sec in and 3/10ths out, so can appear to do nothing on short ones.

avatar image Persona · Sep 09, 2011 at 12:45 PM 0
Share

The animation probably takes roughly two seconds at longest and is about 10 frames?

avatar image Owen-Reynolds · Sep 09, 2011 at 03:05 PM 0
Share

10 frames "wants" to be about 1/3 of a second (somewhere in there.) So, to clarify, you have animation["shrug"].speed=0.16f; to force it to play slower/longer?

avatar image uberdood12 · Sep 09, 2011 at 11:42 PM 0
Share

Do you have it set as, for example: if(Input.Get$$anonymous$$eyDown(x))?

If so try getting rid of the down, as well, try putting it into its own layer: .layer = 1;

1 Reply

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

Answer by PrimeDerektive · Sep 09, 2011 at 07:42 PM

I've encountered this problem too. As Owen said, CrossFade takes at least 0.3 seconds, so if the animation is shorter than that, it won't work. Manually slowing down the animation in script (changing the .speed) will not work either. If it's a one shot animation, you can sometimes getting away with adding a keyframe through the Unity animation editor that is further down the line to artificially lengthen it... otherwise, you're pretty much relegated to slowing down the animation in a 3d modeling package.

Comment
Add comment · Show 2 · 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 Owen-Reynolds · Sep 09, 2011 at 11:37 PM 0
Share

Well, if too short is the problem, CrossFade has an optional 2nd parm for the "fade in/out time": animation.CrossFade("shrug", 0.1f); I've had good results with that.

avatar image PrimeDerektive · Sep 09, 2011 at 11:58 PM 0
Share

Yep... I've gotten models before though where the actual animation is like 5 frames and 0.02 seconds long or something retarded. Setting the crossfade fade in time that low barely results in any visible difference than .Play().

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

Play Animation on trigger enter 1 Answer

I can't script enemy animation 0 Answers

Animation Script Error 1 Answer

How to play an animation at least once before changing 2 Answers

problem not playing animation on keyDown 2 Answers


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