Are you sure the enemy is on a layer that the player's collision shape is looking for?
in project>project settings>2d physics there is a list of names you can give to bit masks and layers.
you can then assign these to colliders in the scene by opening the collision tab on the collider's parent node. A collider only registers collisions with objects whose masks they are specifically ticked to look for. Simply, a Layer is what it is, a Mask is what it collides with.
If nothing still happens, try using
print("output text") to see if your function is even called at all. If it is called, then it's an issue with playing the animated sprite, if it isn't called, it's probably an issue with the above.
Best of luck!