So I was trying to incorporate the previous code but I'm stuck. does my sensor and target have to be in the same manager? I'm not really sure what I'm doing wrong but the function never executes.
Code:
sensor = vizproximity.Sensor(vizproximity.Sphere(15,center = [72,-.57,2]), source = avatar1)
manager.addSensor(sensor)
Avatar2Target = vizproximity.Target(avatar2)
Avatar2Manager.addTarget(Avatar2Target)
def HealthLoss(e):
if e.target == Avatar2Target:
print "Sensor Entered"
Avatar2Manager.onEnter(sensor1, HealthLoss)