|
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?
(comments are locked)
|
|
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. Well, if too short is the problem, CrossFade has an optional 2nd parm for the "fade in/out time":
Sep 09 '11 at 11:37 PM
Owen Reynolds
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().
Sep 09 '11 at 11:58 PM
PrimeDerektive
(comments are locked)
|

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.
The animation probably takes roughly two seconds at longest and is about 10 frames?
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?Do you have it set as, for example: if(Input.GetKeyDown(x))?
If so try getting rid of the down, as well, try putting it into its own layer: .layer = 1;