![]() |
|
|||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#4
|
|||
|
|||
|
One way to do this is create a custom event that's triggered when 3 targets are inside a sensor. Write a function that's called every frame, checks to see how many targets are in the sensor, and sends the event. In the viztask function, use the viztask.waitAny command to wait for either the custom event or 5 seconds:
Code:
waitTargets = viztask.waitEvent(THREE_TARGETS_EVENT) waitTime = viztask.waitTime(5) for trial in xrange(numTrials): d = yield viztask.waitAny( [ waitTargets, waitTime ] ) if d.condition is waitTargets: print 'targets entered' else: print '5 seconds passed' |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| delaying proximity reaction makes sensor unresponsive for the time of delay | jelly | Vizard | 4 | 11-23-2016 05:20 AM |
| sensor radius bug? | lalechuza | Vizard | 7 | 08-25-2015 06:57 AM |
| Orientation selective (Viewing Vector) Proximity Sensor | lmGehrke | Vizard | 2 | 03-17-2015 01:31 PM |
| Proximity Sensor Problem | kmkm | Vizard | 3 | 03-04-2014 12:54 PM |
| CompositeShape proximity sensor | mhtong | Vizard | 1 | 09-24-2012 12:18 PM |