Please or Register to create posts and topics.

Problem with outputs and delays

So. Let's say I have a button, that controls a door. OnPressed opens the door with a 5 sec delay, OnUnPressed closes it. If I hop off the button before the delay ticks down, the door will close, then it will open and stay that way, which should not happen.
What's the "official" solution to this problem? It seems like something that would come up often, but I could not solve it..

- Science isn't about why, it's about why not!

Onpressed: door_open_rl; trigger
OnUnpressed: door_close_rl; trigger

door_open_rl (logic_relay)
OnTrigger: door_close_rl; cancelpending; 0.00
OnTrigger: door; open; 5.00

door_close_rl (logic_relay)
OnTrigger: door_open_rl; cancelpending; 0.00
OnTrigger: door; close; 0.01

cool, I knew I was missing something :D

- Science isn't about why, it's about why not!