Hi, I’m using MECHANIM and I’m having some issues. Essentially, when I press LeftShift, I want to be able to toggle the boolean “IsRunning” (my running animation boolean in MECHANIM) to true, in the else statement set it to false. Buuuut, of course, since I have no idea what I’m doing quite yet, I need your help. This is what I got:
//SPRINTING
if(controller.velocity.magnitude > 0 && Input.GetKey(KeyCode.LeftShift))
{
theAnimator.SetBool("IsRunning", true);
}
else
{
theAnimator.SetBool("IsRunning", false);
}
Just to let you know, I did this at the beginning of the script:
var theAnimator : Animator;
Well that’s about it, hopefully you can help me out on this one!
(NOTE: The script gives NO errors, but when I press LeftShift, nothing happens)