Hi,
I am having a jumping animtion of a character which animates smoothly while running on my “Animation” Window, but the same when tried to animate through script appears to be skipping off few frames thus making some kind of jerky animation.
Code :
void Update()
{
if(Input.GetKeyDown(KeyCode.UpArrow))
{
StartCoroutine(DoJumpAnimation());
}
}
IEnumerator DoJumpAnimation()
{
m_charAnim.animation.CrossFade("jumping");
yield return new WaitForSeconds(m_charAnim.animation["jumping"].length);
}
Here if I press the UpArrow with some interval then it works fine, if at all I keep on pressing the key continuously then I get the problem in animation.
Anybody please help me to resolve my problem.