Announcement

Collapse
No announcement yet.

Dodge/Sprint Button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dodge/Sprint Button

    I'm trying to make a button that will dodge if pressed and released before a certain time, and sprint if held for longer than that certain time. Right now that time is 2 seconds, but it will probably end up being something like .75.

    Here is what I have so far:
    Click image for larger version

Name:	SprintBlueprint.png
Views:	1
Size:	201.8 KB
ID:	1156002

    I don't understand quite how timers work. I'm not sure I should be using event tick. I tried using delay, but that didn't work because it still fired even when I dodged. I tried using a Timer but couldn't get that to work either. With this setup, I can't enter a sprint. Basically, I need the button to start sprint if its held for longer than X, and dodge if held for less than X. I imagine this would be very similar to the code for double tap dodging in unreal tournament. The rest of the code works fine.

    Any help is appreciated.

    Once this is ironed out, i'm planning on making the sprint button activate a jetpack if it is pressed in the air. Right now, if I dodge again while still in the air after dodging, I shoot off at 1000 mph

    #2
    Event Tick is called every frame so you are essentially you're setting Sprint + 1 every couple milliseconds.

    Use a Set Timer Delagate node. I'm not in front of my editor so I can't show you right this second but basically when the timer goes off it fires a custom event of your choosing. From there you can decide what to do.

    Unpopular Minion on the Play Store (Released: January 31, 2016)

    Comment


      #3
      Nice!
      Click image for larger version

Name:	BlueprintWorking.png
Views:	1
Size:	207.1 KB
ID:	1082132

      Now it works just like intended.

      Thanks!

      Comment

      Working...
      X