PhysicsPESensor: OnProductDetected
Invoked when the sensor detects products.This event is still fired for each product when Override is enabled.
Note: OnProductDetected does not support multiple subscriptions. Only the most recent subscription will be called.
Event
void xxxxxxxxxxxxxxxxx(sender: PhysicsPESensor, product: Product);
Parameters
Name | Type | Description |
---|---|---|
sender | PhysicsPESensor | The sensor which detected the product. |
product | Product | The product item which is detected by sensor. |
Example
function OnSimulationStart()
{
SubscribeAll("OnProductDetected", "Physics PE Sensor", OnProductDetected);
}
function OnProductDetected(sensor, product)
{
LogDebug(`${product.Name} is detected by ${sensor.Name}.`);
}