View Single Post
  #8  
Old 12-27-2016, 04:40 PM
Vaquero Vaquero is offline
Member
 
Join Date: Nov 2015
Posts: 62
I think I got it. I just check for the boolean status of the timer before I start a new one AND make sure, there are not already other targets in the sensor.

Code:
	def enter_sensor(e):
		print('{0} entered {1}.'.format(e.target.name,e.sensor.name))
		numTargets = len(e.manager.getActiveTargets(sensor=e.sensor))
		global bTimerActive
		if not bTimerActive and numTargets == 1:
			print('Starting timer.')
			viz.starttimer(0,concurrencyTolerance)
			bTimerActive = True
But maybe there's a more elegant solution?
Reply With Quote