Hey there, I have an animator with 3 layers: Body, Arms and Weapons. Body and Arms work perfectly, however, the Weapons layer looks like it’s playing to (I see the blue bar) but it doesn’t play in the scene, could anyone tell me why?
void Update() {
if (Input.GetButtonDown("Slot1") && !weaponEquipped)
{
animator.Play("equipM4A4", 2);
weaponEquipped = true;
Debug.Log("weapon equip");
}
else if (Input.GetButtonDown("Slot1") && weaponEquipped)
{
animator.Play("unequipM4A4", 2);
weaponEquipped = false;
Debug.Log("weapon unequip");
}
else if (!weaponEquipped && !AnimationIsPlaying(animator, "unequipM4A4", 2))
animator.Play("idleM4A4", 2);
else if (!AnimationIsPlaying(animator, "equipM4A4", 2))
animator.Play("equippedIdleM4A4", 2);
}