Hi what can i do to weapon stop reload when is fire?? thank you so much
You may want to include some more details. Consider explaining in detail:
- what needs to happen
- what is working
- what is not working
- what youâve tried
Do include the script - how to do what you need to do depends on how youâre handling things at the moment.
Are you trying to interrupt an animation?
If so, one method would be to send off an event dispatcher when you begin firing which communicates either with the Anim Instance (if thatâs whatâs controlling your reload animations), and/or use a âMontage Stopâ node to interrupt the reload montage from within the character blueprint itself.
Hard to know for sure though, without seeing your code.
When you start a montage use âGet Current Montageâ and Set an âActive Montageâ reference var.
On Shoot input use âMontage Stopâ (Active Montage).
Youâll need to clear the âActive Montageâ var after this and when a montage completes.
thank you so much my friend for the help
Sorry bro can you explain better with a photo how to conect all cause im in advance im not pro xd thank you so much
This process overall depends on how complex your character mechanics are. What you want to prevent firing, reloading etc. And what weapon actions you have.
Weapon actions are what you can do with said weapon. Anything that requires the character to play a montage would be an action. e.g. Firing, Reloading, deploying/un-deploying bipod.
Instead of using bools, I prefer an enumerator. You can only execute one of these actions at a time. So 3 bools would be bad design and require additional conditional checks.
Basic structureâŚ
Every Action (Firing, Reloading, Jumping, Sprinting etc) should have a scrutinized conditional check to determine if the action can be taken. Thus Can Fire
and Can Reload
functions.
The Can Fire function
first checks against absolute preventative conditions. If those pass, we then check for WepActionStates
that initially prevent, but can be reconciled. e.g. interrupt the montage and reset the action state.
Global WepActionState interrupt
The Can Reload
function would follow a similar structure to Can Fire
. Yet this does depend on your overall design. Do you want the player to stop firing and start reloading if they hit the reload buttonâŚregardless of intent?