greyday01 Posted July 5, 2020 Posted July 5, 2020 I have a button that causes a script to run. If pushed again too soon things get out of sync. Is there a way to make it so it can't be activated again for 5 seconds or so?
maxarturo Posted July 5, 2020 Posted July 5, 2020 Auto State WaitingEvent OnActivate(...) GoToState("Activated") RegisterForSingleUpdate(5.0) ....... .......EndEventEndState State ActivatedEvent OnActivate(...) ;EndEventEndState Event OnUpdate() GoToState("Waiting")EndEvent
greyday01 Posted July 5, 2020 Author Posted July 5, 2020 Thank you Maxaturo. I'm still trying to figure out states and worse functions. They sort of make my brain ache right now looking at example scripts to try to figure out exactly how they are working. At least now that I'm retired I'll have more time to work on learning about them.
maxarturo Posted July 5, 2020 Posted July 5, 2020 Another way you can do this without using "RegisterForSingleUpdate" is: Auto State Waiting Event OnActivate(...) GoToState("Activated") .......etc .......etc Utility.Wait(5.0) GoToState("Waiting") EndEvent EndState State Activated Event OnActivate(...) ; Do Nothing EndEvent EndState
Recommended Posts