Changing Component Colour after it passes through Volume Sensor


I am trying to change the colour of a component after it passes through a volume sensor on a conveyor using a Python Script. Anytime I try to change the colour it just changes the colour of the conveyor not the colour of the component passing through the sensor. Any help would be greatly appreciated


Have you checked this tutorial in Academy?

Modify the code to use the parts detected by your sensor and I think it should work.

That fixed it, thanks a million for your help