Color Sensor
The color sensor component is a scripted component that detects the presence of an entity and its color. For further details on all properties associated with this component and how to use this component with scripting, please see the API documentation.
The detected color is determined by performing a raycast and then measuring the base color and texture of the graphics mesh.
Properties
The color sensor component properties that are accessible through the inspector.
Origin
The start of the detection beam. You can click the select button to select a feature (crease/curve) from the mesh, to be used as the origin. Hover over the feature you want to select and left-click to confirm the selection.
Direction
The direction of the detection beam. You can click the select button to select a feature (crease/curve) from the mesh, to be used as the direction. Hover over the feature you want to select and left-click to confirm the selection. You can right click whilst hovering to negate the direction of the arrow.
Range
The maximum range of the color sensor.
Tolerance
The tolerance used to determine whether a color has been detected. This is determined by using a distance metric from the measured color to any color in the programmed array of colors.
Colors
The programmed array of colors which can be detected.
Color
The detected color index, or -1 if no color is detected.
Object
The detected entity, or null if no entity is detected.
Blocked
The material used when the sensor is blocked, or null to keep using the material of the graphics component.
Cleared
The material used when the sensor is cleared, or null to keep using the material of the graphics component.