You can use the Direction control scenario to detect when a person or vehicle moves in a specified direction within a defined area. The direction is defined by the path settings.
The following image shows a configuration for a Direction control scenario: