How long does a "tap" on screen last?
AJaymz
Member, PRO Posts: 164
If you tapped your screen. How long does the press last for? I just want to make sure some of my codes will execute during the tap time before the release. Any idea?
Comments
Never rely on touch is pressed for long strings of code. Wrap them in a FOR timer set to .03 seconds and run to completion checked. .03 is one code scan cycle.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
It isn't too long of code, but I would feel safer with a timer now. Thanks!
I always use "After 0 sec run to completion" if there is any chance the code won't complete.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
With after zero seconds the timer will keep running. Not a good idea.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru I have always used this method and it hasn't caused any problems obviously that doesn't mean you aren't right. My logic is once the rule is no longer active the timer won't run is this incorrect? Maybe the one of the GS team can answer this @ForumNinja can you find out and let us know the answer?
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
If you have rules with conditions inside the timer they would fire again if the condition becomes active again. It would be fine for behaviors that only fire once like a change attribute but say a constrain attribute would stay active. When you check run to completion once the timer is active it will ignore the condition of the rule it is in. As I said it works because of the type of logic you're putting in the rule but other types of logic will not work properly. That is why the method I showed would work with any type of logic because the timer only runs for one code cycle and resets.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thanks I had not thought this through before. After reading your explanation and doing a test it now makes logical sense.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
That's why I'm the guru of logic
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS