- Home /
Problem playing another animations to the ThirdPersonController Script Automatically
I got a real problem playing any other animations automatically when pressing any button within the ThirdPersonController.js Script .. Look at the Animation Sector Area within your Script too which is :
// ANIMATION sector
if(_animation) {
//_characterState == CharacterState.Jumping ||
if(controller.collisionFlags == CollisionFlags.None)
{
if(!jumpingReachedApex || controller.collisionFlags == CollisionFlags.None) {
_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.Play(idleAnimation.name);
}
else
{
if(_characterState == CharacterState.Running) {
_animation[runAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, runMaxAnimationSpeed);
_animation.Play(runAnimation.name);
}
else if(_characterState == CharacterState.Trotting) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, trotMaxAnimationSpeed);
_animation.Play(walkAnimation.name);
}
else if(_characterState == CharacterState.Walking) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, walkMaxAnimationSpeed);
_animation.Play(walkAnimation.name);
}
}
}
}
Now if I made a condition to play another animation (Kicking for example) within this area it won't be played unless I hold the button down ! I knew precisely that the problem is a problem of another conditions existed resisting my Kicking Animation because they had the priority to be played ! I tried also to make the PlayMode.StopAll trick and it didn't work with me , still can't play it automatically unless I hold the button ! Although I am setting the Input.GetKey () , not the Input.GetKeyDown () !! I wonder how the Animation Attributed to the Jumping Condition is playing automatically when pressing the Space button only once .. while others are not ?!
Please Help me in my issue ! by any means.
Your answer
Follow this Question
Related Questions
Help ThirdPersonController Script 0 Answers
Respawn script and door animation help 0 Answers
mecanim animation problem 0 Answers
Way to have mulitple input? 1 Answer
play animation when moving,and idle animation when stand still 1 Answer