Force FlipFlop to trigger?
I realize this may sound like a strange question, but I'm currently using the FlipFlop node to control object interaction for my game. When the player left clicks on an object, it is picked up using a physics handle. If they left click again, the flipflop node routes to the action "drop" (B).
My problem is that I also have a third option for throwing the object with Right Click. The problem is that if I pick up the object and then throw it, the flipflop isn't toggled (IE it remains set to B after I Right Click) and I need to left click on the next object twice to get it back to the "pickup" state (A).
I'm wondering if there's a way to trigger the flipflop after I throw the object or if there's a way to reset it back to its default state (A)?
Now that I think about it though, a better solution might be to not use a flip flop at all. You instead connect a Branch to the Left click and connect a Bool named "Holding Object?" to the branch. If it's false you would run the "Pickup" event and if it's true you would run the "Drop" event. Then on the "Throw" and "Drop" events you set "Holding Object?" to false I think this would solve the problem without having to try to figure out the logistics of the various states a Flip Flop node could be in.
answered Mar 30 '17 at 10:32 PM
I have a similar challenge to this.
My solution is to set a boolean variable that can be applied as a condition to a branch just after the flip flop. Specifically: on the B stream: if this condition is TRUE, then route back up to the A stream. If it's FALSE, then continue on the B stream.
So, for you, the C action (throw) would set the boolean to TRUE. Then when you want to pick up another item (having just thrown one), the B stream (drop item) would check the bool and simply route back up to A (pick up). I guess you'd need to have the A stream reset the bool to FALSE in order for the sequence to resume normal flow. But that's as far as I've got with my logic.
But here's my problem: my flip/flop is in a HUD widget (where the alternate A/B events are triggered). My C action (which puts it out of whack) takes place in my main CameraPawn BP. It's a left mouse-click.
So I've been trying to send an interface message from the C action that sets the bool in the HUD —but the HUD isn't receiving the message! Grrr. Can't seem to call a left mouse event in the HUD. Hmpf. Might need to take a break from this—my head's spinning.
answered Mar 30 '17 at 02:44 PM
Just a quick screencap to illustrate my answer:
answered Mar 30 '17 at 04:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here