Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: keirankozlowski on July 13, 2017, 05:08:58 PM

Title: Possible to end a wait early?
Post by: keirankozlowski 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?
Title: Re: Possible to end a wait early?
Post by: LordHorusNL 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.
Title: Re: Possible to end a wait early?
Post by: tcmeric 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.
Title: Re: Possible to end a wait early?
Post by: keirankozlowski on July 14, 2017, 08:42:44 AM
Sweet, thanks guys.
Title: Re: Possible to end a wait early?
Post by: HeathClose 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
Title: Re: Possible to end a wait early?
Post by: djaydino 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 (https://hutonggames.fogbugz.com/default.asp?W548)