changing default FPS template weapon to shoot full auto
As of UE5 use of the PlayerInputComponent for registering input has been replaced by the EnhancedInputComponent.
Projectile
Luckily the First Person template comes with a projectile, however it's currently semi-auto and we want full-auto glory.
Full-Auto
The idea here will be when the user presses the fire input we start a timer which executes Fire() every X seconds on a timer, and stops once the fire input is released.
Input Binding
Add two new InputActions and bind them to input events and callbacks
Notice the difference from UE4 where we would have used a single action with two different input events (IE_Pressed and IE_Released) versus UE5 where now each action uses the same Triggered event (for more details UE docs here)
Implement Callback Functions
.h
.cpp
InputAction setup and mapping
Like mentioned since UE5 uses the new EnhancedInputComponent there is a bit more we need to do to hookup the actual input.
Create two new Input Action data assets
InputAction data assets
one for "Pressed" and one for "Released
creating our own Pressed and Release actions
Next add them to the Input Mapping Context
only adding mouse support for simplicity but you can add whatever other input you desire
IMC_Weapons: Input Mapping Context add two new Input Actions
Lastly we need to assign the new Input Actions to the weapon blueprint