Elegant solution to play certain animations depending on what weapon a player is using?

On character bp create an integer variable. For every weapon you equip, set this integer variable to a fifferent value. This value will be switching between state machines on anim bp.

On anim bp make all your state machines for different weapons. Get a node switch by int( cant remember exact name). Hook your state machines to that node and hook the node to final state.

On anim bp event graph cast to character and get the integer variable that you created earlyer. Now create a new integer variable in anim bp.

Now use the variable you got from character bp to set the integer on anmib bp.

Go to anim graph. Get the integer variable. Hook it up to the switch by int node where your state machines are connected. Done.

Wow I am bad at explaining stuff :)))