Switching between more than one weapon

Hi,

I’ve got a weapon system in place that allows the character to switch between two weapons. A rifle is attached to the players back and a pistol is attached to their hip. There are two animations per weapon (equip and un-equip) of which both sets of animations are different. I’m having alot of trouble getting the following scenario to work:

=>Character un-equips pistol (holsters it on hip) then equips rifle from back.

I’m using AnimMontages within my PlayerCharacter blueprint. All the equip/un-equip animations play on an Upper Body slot from spine_01. At the moment when the player un-equips the pistol all the user sees is the character equip their rifle, I know the pistol un-equip animation is playing (after doing some testing) but the equip rifle animation plays over the un-equip animation. I need the un-equip animation to play, then the equip rifle animation to play but so far I’ve been unsuccessful.

The things I’ve tried so far are:

Checking for whether the current montage is the pistol un-equip montage before running the equip anim montage. =>This never runs the equip anim montage because it checks this while the pistol un-equip montage is still playing.

Using a while loop and keep checking the current montage, once it’s not playing the un-equip montage play the rifle equip one => This just caused an infinite loop

Tried using a for loop with break to avoid the infinite loop
=>(I kind of knew it wasn’t going to work either).

Tried altering the playrate and blend in times of the animations but this didn’t work either.

I’m thinking a possible solution could be to use anim notifies and create a reference to the AnimBlueprint class, on an event tick in the PlayerCharacter blueprint, check whether the specific anim notify has been called (from the un-equip animmontage), if it has, play the equip animation? I know this probably isn’t a good idea performance wise but it’s one of the last things I can think of.

I’m new to using UE and blueprints so any guidance on getting the animMontages to play one after the other would be great. At this point I’m beginning to pull my hair out.

Hi,

After reading this question UE AnswerHub Animation not played completely when root motion on - Character & Animation - Unreal Engine Forums I was able to figure out a solution. I moved all the anim montages over to the AnimBlueprint to gain access to the delay node. After which it was just a case of using the delay to make sure the animation finished.

Thanks