playMaker

Author Topic: Possible to end a wait early?  (Read 1572 times)

keirankozlowski

  • Playmaker Newbie
  • *
  • Posts: 4
Possible to end a wait early?
« on: July 13, 2017, 05:08:58 PM »
As the title would suggest, I'm hoping to find a workaround for ending the wait early. A potential use case could be, "Wait for 4 seconds, but if the player hits this trigger end the wait."

Has anyone come up with anything?

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Possible to end a wait early?
« Reply #1 on: July 13, 2017, 05:28:13 PM »
Just make the wait time a variable and set it to zero when the player enters the trigger and then the wait action will just trigger right away, this way you can also lengthen the time if you want.

You will probably have to send the new variable amount from another fsm using set fsm float.
« Last Edit: July 13, 2017, 05:30:40 PM by LordHorusNL »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Possible to end a wait early?
« Reply #2 on: July 13, 2017, 08:22:12 PM »
You can use both a wait action, and a trigger event on the same state. Whichever comes first (the end of the count down, or trigger), will fire first. They can even both use the same event. Or you can make two events.

keirankozlowski

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Possible to end a wait early?
« Reply #3 on: July 14, 2017, 08:42:44 AM »
Sweet, thanks guys.

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Possible to end a wait early?
« Reply #4 on: July 14, 2017, 08:44:15 AM »
also... a global event will always jump an fsm to the state the event is tied to... so if the next state after the wait receives an event because the button is clicked.. it would bypass the wait

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Possible to end a wait early?
« Reply #5 on: July 14, 2017, 10:39:42 AM »
Hi,
All 3 answers will work, if you want to learn more about global events and transitions you can watch this video :

You can also find many tutorials here