0
\$\begingroup\$

I have the following issue:

I have some logic which I call to Set Ignore Move Input on for a specific player character, based on a boolean. However, after half a second, I set it back on.

Everything works great, I can not move my character while it kicks.. However, if I press the "kick" input twice in succession.. the Set Ignore Move Input breaks and never gets turned off, even if I "Kick" again later.

Here is the blueprint .. Any help is greatly appreciated (and yes I realize that to somebody more experienced this blueprint makes little to no sense, but I'm just starting out... My core issue as a software developer here is I don't understand what locks me out of the logic that would reset Ignore Move Input back off).

Thank you for your time!

BLUEPRINT

\$\endgroup\$
4
  • \$\begingroup\$ Not going to post an answer as I'm not completely sure of the solution. Usually, events and delays cause issues. Your solution depends on what you want. If you want to be able to press the kick button twice in quick succession, then try separating the delay onwards into a new custom event and call that from after the setIgnoreMoveInput. OR If you don't want the button to be able to be pressed twice quickly, add a branch with the condition Kicking = false to proceed so that the event code can only be running once at a time \$\endgroup\$
    – Natalo77
    Mar 3, 2020 at 9:26
  • \$\begingroup\$ Thanks a lot for your suggestion! I'm going to try that out today! I am making a fighting game, so yes, there will be button mashing, which may not break the flow. And no kicking a second time before the animation is finished may not be executed. \$\endgroup\$
    – Seyia X
    Mar 3, 2020 at 9:41
  • \$\begingroup\$ You might as well go with the 'critical section' approach that I describe in the second approach then, as this will only ever allow one input action to be running that section of code at once. If you want to understand better what I mean by critical section, look up parallel programming with semaphores and 'critical sections' \$\endgroup\$
    – Natalo77
    Mar 3, 2020 at 11:11
  • 1
    \$\begingroup\$ Great. I've just gotten back and will open my UE now.. Thank you for the new terminology there. Sounds like I'll be able to use it also for implementing my Combo-system where I need to have a lot of very precise time-out logic. \$\endgroup\$
    – Seyia X
    Mar 3, 2020 at 17:45

1 Answer 1

1
\$\begingroup\$

@Natalo77

Thank you! Your tips solved the issue. The code now looks as follows (I've collapsed the entering and exiting of "Kicking"). I've also made a Pure function which will return whether or not an action is being executed.

FIX

\$\endgroup\$
3
  • \$\begingroup\$ Great! You should mark this as an answer to your own question. That's some really smart function encapsulation you've got going on there, so congrats! I'm glad you were able to solve the issue! \$\endgroup\$
    – Natalo77
    Mar 5, 2020 at 10:13
  • \$\begingroup\$ It was really you who solved it : ) My character event graph has gotten really big now. With dashing forward/backward, running, kicking effectively and everything. Thanks again for being a part to the puzzle ! \$\endgroup\$
    – Seyia X
    Mar 5, 2020 at 11:13
  • \$\begingroup\$ I didn't give you the solution, just pointed you in the right direction. Also if your event graph is getting large you should definitely take a look at component based development \$\endgroup\$
    – Natalo77
    Mar 5, 2020 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .