Whenever I press Left Shift in play mode which is my running cue, Unity freezes and I need to use task manager to close it. Does anyone know what to do if this happens. Here is my script
#pragma strict
var Hands : Transform;
var PlayAnimation : boolean = false;
function Update()
{
while(Input.GetKeyDown(KeyCode.LeftShift))
{
PlayAnimation = true;
if(PlayAnimation == true)
{
Hands.animation.Play("GlockRun");
}
}
if(Input.GetKeyUp(KeyCode.LeftShift))
{
PlayAnimation = false;
}
}
↧