Jump to content

Recommended Posts

Posted

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?

Posted

Auto State Waiting

Event OnActivate(...)

GoToState("Activated")

RegisterForSingleUpdate(5.0)

.......

.......

EndEvent

EndState

 

State Activated

Event OnActivate(...)

;

EndEvent

EndState

 

Event OnUpdate()

GoToState("Waiting")

EndEvent

Posted

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.

Posted
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...