- Home /
Mecanim add weight to certain animations
I have an attack animation. This animation needs to play no matter what, over all idling and walking. I made an AnimatorController that controls the idling, walking, blocking, and attacking. A variable, isAttacking, controls when the model plays the attack animation.
The attack animation works - it plays when you are idling. However, when you are walking, most of the time it doesn't play.
Here's the AnimatorController:
And here's (the important parts of) the script that governs it (Boo):
import UnityEngine
class PlayerAttack (MonoBehaviour):
private animator as Animator
def MeleeAttack() as void:
animator.SetBool('isAttacking', true)
Invoke("StopAnim", 0.1)
def StopAnim() as void:
animator.SetBool('isAttacking', false)
To make the attack animation play no matter what, is there a way to add weight to that animation specifically?
If not, is there a workaround?
Thanks in advance
You can add weight to the layer with this. Check your transition from Walk to Attack. Consider placing Attack on a higher layer with a $$anonymous$$ask to walk whilst attacking.
But if I use layers, can I make transitions from certain animations across layers?
That is what was stopping me beforehand.