- Home /
Question by
Maisonadam1994 · Apr 10, 2013 at 08:22 PM ·
animationjumpland
jumping and landing workflow
okey when i jump, the jump animation finishs before the character lands , what i want is , example : if i jumped from a hill i want my character to repeat a couple frames from my jump animation till he hit the ground , and he will play the land animation , btw here's the script that im using ( constructor third person player controller )
// ANIMATION sector
if(_animation) {
if(_characterState == CharacterState.Jumping)
{
if(!jumpingReachedApex) {
_animation[jumpPoseAnimation.name].speed = jumpAnimationSpeed;
_animation[jumpPoseAnimation.name].wrapMode = WrapMode.ClampForever;
_animation.CrossFade(jumpPoseAnimation.name);
} else {
_animation[jumpPoseAnimation.name].speed = -landAnimationSpeed;
_animation[jumpPoseAnimation.name].wrapMode = WrapMode.ClampForever;
_animation.CrossFade(jumpPoseAnimation.name);
}
}
else
{
if(controller.velocity.sqrMagnitude < 0.1) {
_animation.CrossFade(idleAnimation.name);
}
else
{
if(_characterState == CharacterState.Trotting) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, trotMaxAnimationSpeed);
_animation.CrossFade(walkAnimation.name);
}
else if(_characterState == CharacterState.Walking) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, walkMaxAnimationSpeed);
_animation.CrossFade(walkAnimation.name);
}
}
}
}
Comment