Switching Weapons

Hi Doudou29236,

as with most of the stuff there are several approaches to this, one is to use custom event and timers.

When you’re working in blueprint, under the weapon, you create following custom events:

  • PullTrigger
  • ReleaseTrigger
  • Fire

PullTrigger, when called will set a timer for function call, here you can define how much bullets you want to shoot per second. This timer will call the Fire custom event which will spawn a projectile, play sound and so on any time it’s called. The ReleaseTrigger will clear the timer, effectively stopping the fire.

Now, in your hero blueprint, on button pressed, you call the pulltrigger and on released, you call releasetrigger.

Check this video out, everything will be clear.

Regards,