FlipFlop fails after 2 uses
I'm having a problem where I'm using two different keys to either activate/deactivate or change weapons on my character (One button for each weapon). Activating and deactivating a weapon works perfectly an infinite number of times (or as many as I can be bothered testing). However, when using the keys to swap weapons directly (ie one weapon is active, pressing the key for the other weapon deactivates the current weapon and swaps to other), it fails after 2 cycles. It simply stops and you need to press the corresponding button twice to start the event chain over.
Anyone ran into this? Have any idea why?
Alright, after shaking my head around a bit I came up with a solution that works infinitely and doesn't require the use of flipflop. I altered the sequence above to the following:
Now, both of these are called in the animation blueprint for the character via cast to character and I have anim notifies and custom events to prevent any action during the animation of these actions (ie, set dummy 2 to true means the animation for activating the weapon plays, setting it to false means the animation for deactivating the weapon plays).
Just thought I'd leave this here in case anyone else have problems, from what I can tell there are a quite a few people having issues with flip flop since it never goes back to false false after it is initialized.
answered Jan 07 '19 at 03:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here