Play different blendspace after picking up weapon

Hi there, so recently I made some nifty code where if you walk over a weapon, it automatically makes it attached to the player’s right hand socket. However, I want it so that when it is attached to the player’s socket. It will play a different blendspace for the animation blueprint.

(Below is the coding for the gun attaching and what I theorize what I would need to do next outside of the comment)

If anyone that can help me out, please let me know!

You can set a variable and use that value in the animation blueprint to transition to the state with the respective blendspace.

What would that look like? Can you be more specific in a step-by-step process?

There is still a lot of information missing, so I’m going to assume some things, the walk/run of the player is different for each weapon it carries, and that’s the reason for the change of blendpsaces.

Also, this is one way of doing it, so take it with a grain of salt.

Let’s say each weapon is identified by an enum:

When the player picks a weapon, it sets a variable to that weapon:
002

Now, the animation BP, checks which current weapon the player is holding:

And at the animation graph you make the transitions to the respective state:

Where each walk/run/weapon contains the respective blendspace.

Naturally, the more weapons the more complex it becomes, since more transitions must be set.

Maybe some else has a more efficient and cleaner way to do this.

1 Like

Hey, sorry it’s been a while. If you don’t mind I have one more question. In your third screenshot you have the BP Third person pin connecting to the target pin of the enum variable. How? What do I need to do in order to get the target pin of a variable? Thanks as always!

It’s an enum variable inside of the animinstance. Probably updated from the owning character blueprint that also has currentWeapon as an enum.