Although I agree it has been answered many times - it's not always correct, so please find the correct approach here:
if (GetComponent().GetCurrentAnimatorStateInfo(0).IsName(“Attack")){
print("Playing attack anim!");
}
Keep in mind this only works with single layered animators.
↧