x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.21
Tags:
more ▼

asked Jan 06 '19 at 10:08 PM in Using UE4

avatar image

Crowley Caine
643 8 9 15

avatar image Crowley Caine Jan 06 '19 at 10:15 PM

Adding a picture of the code which I simplified to show what the functionality is. It does a lot of things but this is the main sequence and where the issue is. alt text

dummymodes.png (112.9 kB)
(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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:

alt text

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.

dummymodes2.png (126.8 kB)
more ▼

answered Jan 07 '19 at 03:07 AM

avatar image

Crowley Caine
643 8 9 15

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question