- Home /
unexpected movement with mecanim
Basically I have a punch attack set up in a similar way to the jump animation in the mecanim tute project. But when I press the key, it plays the animation like its supposed, but then when I go back to running, it unexpectedly starts to play the punch animation in a loop. im guessing this is because its only given if were in the baseCurrentState. How would i go about assigning it to any state?
I simply used the same line of code for the jump trigger and changed it to play my required animation in the animator, and to trigger by a keypress. I wrote out a public float at the top of the code too. Thanks
public bool unarmed_punch1;
if(baseCurrentState.IsName("Base.Locomotion")){
if(Input.GetKey("p")){
animator.SetBool("unarmed_punch1", true );
}
}
Your answer
Follow this Question
Related Questions
Mecanim and Camera Problems 0 Answers
Animation in edit mode with Mecanim 0 Answers
Can Mecanim/Animator be used to make Enemy AI's? -1 Answers
Dynamic Mecanim animation speed/time 1 Answer
Mecanim issue: Twitching when blending into blendtrees 1 Answer