Trigger callback functions
Child scripts, or customization scripts can include a trigger callback function (which is one of many system callback functions), when associated with a vision sensor or a proximity sensor.
Some conditions apply as to the location of the trigger callback function: if a trigger callback function is present in a child script as well as in a customization script, both attached to the object triggering, then the child script will be called first, and the customization script second.
A vision sensor can generate the trigger signal inside of the vision callback function. The trigger callback (if present) is then called as in following example:
A proximity sensor generates the trigger signal when an object is detected. The trigger callback (if present) is then called as in following example:
In Python, a trigger callback function can only be implemented via a non-threaded script, and it should be explicitly activated with a luaExec command: