Blocking shooting while running
The ability to shoot while running looks unrealistic due to our running animation, so it's best to disable shooting while running.
I highly recommend that you first try to implement this logic by yourself, as a homework task.
Improvement can be done after Lecture 065 or at the very end of the course.
Solution
Add a new flag to the base weapon class
FireInProgress
Also add a function to the weapon component:
In the character class, we create the
OnStartFire
function and bind to it when firing is started:
After that, add the code for the
OnStartFire
function and update the other two functions:
Additional details with calling parent functions
StartFire
andStopFire
can be found in the repository
Last updated
Was this helpful?