Product: GetProductPosition
This function is called to retrieve the current absolute position of a product component, specifically at its leading edge. (we don’t support sorters)
The product’s position is calculated relative to its parent transporter, using the formula:
(Parent transporter position + distance traveled) + distance to leading edge = product position
The leading edge refers to the foremost point of the product in the direction of travel.
🔁 Function
Array GetProductPosition(product: Product);
⚙️ Parameters
Name | Type | Description |
---|---|---|
product |
Product | The product object |
↩️ Return Value
Array of Number (X, Y, Z) Positions
📝 Example
var pos = GetProductPosition(product);
LogDebug("Product at " + "X: " + pos[0] + " Y: " + pos[1] + " Z: " + pos[2]);