State machines for different equipped weapons

I have a character that uses various melee weapons such a sword and spear. At the moment, my animation blueprint has state machines that control the Idle and Walk/Run without a weapon. But for example, if I equip the spear, I want the Idle and Walk/Run to switch to Spear Idle, and Spear Walk/Run. How would I go about telling the animation blueprint to swap out the empty hand animations to equipped animations? Is this done in the state machine, or is it done in the anim graph?

Ok cool. I know how to create an enum variable for my weapons, but I didn’t know you could use it to switch anim blueprints. I’ll look into that. It would be nice to have a less complicated graph of statemachines and splitting it up would be helpful. Thanks!

Maybe you might create a Enum Variable to you character that inculdes the various states for example non-weapon/ range weapon/ non range weapon etc. Than you can create a logic to set this variable and add custom event to change animblueprint.
The logic of it when you have a weapon you set another Animblueprint.
May be it works.

Creating ENums; right click where to you want to locate the file For example

1-create a folder for Weapons you may place it. When you right click you can find it "create advance assets\Blueprints\Enumeration. Double click and add states by clicking new button. So you have enum file name it Enum_State

2- You may create variable (and variable type should be Enum_State) to both weapon parent and character have to be added this flie as variable. To do this; edit character blueprint create new variable name it than select the variable and type Enum_State (what name you gave), when complie you should see the states as form.

3- In side scroller blueprint add custom event name it “updatestate” and at the right of the editor you may see “input” click and add an input called “state” and select variable type as you quest “Enum_State”. So this means this event needs a state to trigger.
And drag drop the mesh and create “set anim instance class”
You can duplicate the animBp for your states. And you can sett the animations what you want. I create it as TPS_Melee .
In Blueprint you can use “select” node and you may see the index, click and find your state enum. and you have you options:D Than drag drop mesh and create “set anim class” than PLUG SELECT NODE RETURN TO NEW CLASS.
And you have to see like in the pic. So you can select the anim class with the selection (enum state)

It seems a little bit confusing please if you lost let me know. This way is a gneric method to handle the anim states.
When you active a weapon, you only need to trigger the “update state” custom event in your equip the weapon logic.
Good luck
Imgur

I got it working now, thanks. Although one thing I noticed the switch from one animation blueprint to the other is very sudden, no way to smooth that out?

I created custom events for each switch and connected that after the enums.

341527-abpswitch.jpg