- Home /
animation switch too fast
i have two sets of animation, one is idle the other is attack, once the attack is played it cross fades to the idle state too quickly, anyway to slow this down?
i tried slowing down the animation itself, it doesn't have any effect on the cross fade speed (animation switch)
Answer by MartinTV · Jan 06, 2021 at 05:36 AM
Waaaay late to the party here, 8yrs, so might not be relevant BUT I cached the current state (on the 3rd layer), called rebind, then used animator.play to force the character into the animation they were just in with the normalized time value for the cached sate.
void RebindAndRestoreAnimator()
{
// Cache info
Animator anim = PlayerInfo.playerAnim;
AnimatorStateInfo info = anim.GetCurrentAnimatorStateInfo(3);
// Rebind then resetinfo
anim.Rebind();
anim.Play(info.shortNameHash, 3, info.normalizedTime);
}
Answer by Berenger · May 08, 2012 at 01:58 PM
Crossfade has a fadeLength parameter doing just that. Or do you mean that it crossfades the idle during the attack which means the strike isn't complete and looks weak ? Then you need a higher layer for the attack animationState.
no i mean once the attack is completed, it returns to the idle state too quickly
basically i have a tail behaviour, once it attacks it hovers in the airs for a little while, after the animation is complete the tail goes back to its original position way too fast. Was wondering if it was possible to modify the speed of the fade between the animations