void AnimationChecker() { //LEGS if (RB2D.velocity.x != 0f || RB2D.velocity.y != 0f) { LegAnimator.SetBool("IsMoving", true); } else { LegAnimator.SetBool("IsMoving", false); } //Weapons if (WeaponsOnHand [WeaponIndex] != null) //this will make the system know to make the weapon on hand layer dominate the other ones. { PlayerAnimator.SetLayerWeight(WeaponsOnHand [WeaponIndex].GetComponent <WeaponClass> ().AnimationLayerIndex, 1f); CurrentAttack = WeaponsOnHand [WeaponIndex].GetComponent <WeaponClass> ().AttackAnimation; } else //this is to makes sure the weapon layers don't mess with the fists layer { for (int i = 1; i < WeaponPool.Length; i++) { PlayerAnimator.SetLayerWeight(i, 0f); } } }
//To check if it's moving or not void AnimationChecker() { LegAnimator.SetBool("IsMoving", true); }