How to stop/block weapon switching during the reloading of 'Child Actor' based weapons?

Hi all,

Having trouble stopping the ability to weapon switch during reloading.
I have a two weapons, a pistol and a shotgun. They’re child actors, with a ‘Gun Base’ parent.

The call to reload comes from the R key in the Third Person Blueprint, which then casts to the ‘Gun Base’ which in turn sends to the two child actor weapons each with their own reload animations, length etc.

Note: The weapon switching is also stored in the Third Person Blueprint, mouse wheel axis.

I have tried with a simple variable ‘IsReloading?’ and delay, on the end of the Third Person Blueprint call to reload, that stops the weapon switch. The problem is though the shotgun reload takes 6.5 seconds and the Pistol is 2 seconds. So it blocks the weapon switching in frustrating way for the player on the pistol.

I cannot find a way to determine the time of the custom event ‘Reload’ for the two ‘Child Actor’ specific weapons in the Third Person Blueprint or split them apart from each other.

An acceptable alternative might be that if you do weapon switch it at least cancels the reload and animation, and doesn’t add ammo. Unfortunately this is not the case and the reload sequence continues entirely off screen while holding the newly switched weapon, Octopus style! :sweat_smile:

Can anyone help with this?
Would be much appreciated.
Thanks!

1 Like

You should be able to use a bool…bIsReloading. On input set it to true. In the reload animation use an anim_notify to update ammo count and reset bIsReloading.

On switch input check bIsReloading = true.

1 Like

Thanks for the reply!

I have added animation notifies to the end of the pistol and shotgun reloads. e.g. ‘PistReloadEnd’
However how do I call / reference these in the Third Person Blueprint, which node to use?

Also would these work bearing in mind the weapons reloading animations are stored in the individual weapon Child Actors?

Okay had another go at fixing this and came up with this, not sure if it’s the most efficient solution but it seems to do the trick and now everything is working as intended!

Created two reload events one for each of the guns respectively inside their ‘Child Actor’ blueprints to split them up. Then put them through a looped multi-gate node, with separate delays which match the reload times of each gun.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.