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"

Multiple FlipFlop

Hey Everyone,

Quick question, I have a selection of buttons on a menu and I have assigned spawned actors to them. At the moment when you press a button an object is spawned. If you press it again its destroyed and if you press another button another object is spawned and the previous destroyed. This all works fine.

The issue I have is when you press a button its actor is spawned, if you then go on to another and return to a button or the same button twice it needs to be pressed twice ( I am guessing it continues where it left off with the flip flop)

Any help or advice would be really appreciated.


Product Version: UE 4.14
more ▼

asked Jan 03 '17 at 02:11 PM in Blueprint Scripting

avatar image

3 1 4 6

avatar image Titirez Jan 03 '17 at 02:17 PM

Are you using any of these nodes ? If yes, in what order?

alt text

capture.png (98.1 kB)
avatar image IronClad Jan 03 '17 at 11:02 PM

Just the Get Player Controller & Set, am I missing a node?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If I understand what you're trying to do...

You need a second set of flipflops and a callback.

Flip Flopping the Flopped Flips

Rereading your question, this may not be what you were asking about.

You want to Spawn on the first use of a button...

Despawn that and spawn another - on each subsequent use of the same (or other) buttons?

If that is the goal, you don't actually need a flipflop.

You can just validate the last spawned actor ...

If it exists, destroy it.

And whether it exists or not, spawn the next one. Destroy if Valid- Spawn Always

more ▼

answered Jan 03 '17 at 02:26 PM

avatar image

766 22 7 36

avatar image IronClad Jan 03 '17 at 11:00 PM

Nice one, thanks for that. It seems to be much more stable and consistent now.

The only other issue is the double clicking. Button A & B, when I click A, the A actor is spawned. When I then click B, the A actor is removed and I have to click B again to spawn the B Actor. If I then click A, the B actor is removed and I have to again click again to spawn the A actor.

Any Ideas how to fix this?

alt text

bp_button.jpg (114.8 kB)
avatar image Looniper Jan 04 '17 at 12:44 AM

Are you intending to hide the mouse or show it as they spawn?

I don't see any reason it would fail to work on every other click. You could simplify it down a bit, but I don't know that it will help.

Simplified Spawn and Kill M_Sprink

I'm using Mouse Release out of habit. You may try changing to On Click or Mouse Down to see if that helps the problem.

spawnandkill.png (193.5 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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