- Home /
Question by
alexanderameye · Dec 24, 2013 at 05:35 PM ·
animationcharacterkeyboardkeycode
Issue with sprinting animation script
I followed the unity mecanim tutorial, and I now want to edit the script that if I press and hold the left shift button, the character plays, the running animation, and when I go back to walking, the walking animations starts running, but when I pressed shift, the character keeps running, even if I stopped pressing shift. Code snippet:
//SPRINTING
if(currentBaseState.nameHash == locoState)
{
if(Input.GetKeyDown(KeyCode.LeftShift))
{
anim.SetBool("Sprint", true);
}
}
Comment