Sensor
The sensor component is a scripted component that detects the presence of an 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 state of the sensor is true if the sensor is blocked, and false if the sensor is cleared. Only the first entity that was found intersecting the detection geometry is detected by the sensor.
Properties
The sensor component properties that are accessible through the inspector.
Geometry
The detection geometry is one of the following:
- Bounding Sphere - A bounding sphere around the entity and its descendants.
- Bounding Box - A bounding box around the entity and its descendants.
Object
The detected entity, or null if no entity is detected.
Layer
The collision layer for detecting entities. Entities with layers that are set to collide with the specified layer will be detected by the sensor.
Kinematics
Whether entities with kinematic rigid bodies should be 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.