View Single Post
  #3  
Old 11-22-2016, 10:02 AM
jelly jelly is offline
Member
 
Join Date: Feb 2016
Posts: 38
I have tried this code but what it does is, it triggers the action as long as the sensor is still entered, after 2 seconds and does not do that if the sensor is exited before 2 seconds have elapsed.

I actually think this might be a different issue:

I want an action to be triggered with a delay, every single time a sensor is entered. If I use waitEnter and waitTime what I achieve is that I "block" the sensor - nothing is registered until the action (and the 2 second delay) are carried out. So it cannot be that I trigger the action EVERY time a sensor is entered, because the 2 second delay creates a minimum of time that needs to have passed before another sensor entry is even registered. Basically, I want the sensor to be entered instantly, each time, and only the action - which is a consequence of the sensor entry - should be triggered with a delay.

Another illustration:

1) If I approach an object, I enter its sensor and I trigger an action of that object.
2) If I want a 2 second delay: I approach an object, I enter its sensor and I trigger an action of that object only after 2 seconds.
3) The problem comes now: If I approach an object a second time within one second of the first time, nothing will happen, because the program is still carrying out the action with delay scheduled as a response to the first approach.
Reply With Quote