Distance Sensor

The distance sensor component is a scripted component that detects the presence of an entity and measures the distance from the sensor to the detected entity. 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 entity is the nearest entity to the origin of the detection beam. This is implemented by performing a physics raycast.

Properties

The distance 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 for the distance sensor.

Layer

The collision layer for detecting entities. Entities with layers that are set to collide with the specified layer will be detected by the distance sensor.

Kinematics

Whether entities with kinematic rigid bodies should be detected.

Distance

The measured distance to the detected entity, or 0 if no entity 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.