override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { controlCharacter = animator.GetComponent <ControlCharacter>(); iKMovement = animator.GetComponent <IKMovement>(); timePass = idleId = faceId = 0.0f; idleUpdate = sneakUpdate = idleFaceUpdate = false; timeForLastIdle = originalTimeForLastIdle; timeForNextIdle = timeForChangeIdle; animator.SetFloat("Idle", 0.0f); if (enableFaces) { animator.SetFloat("IdleFace", 0.0f); } if (Input.GetKey(KeyCode.LeftAlt)) { animator.SetFloat("Sneak", 1.0f); sneakId = 1.0f; runEnable = false; } else { animator.SetFloat("Sneak", 0.0f); sneakId = 0.0f; runEnable = true; } }