Click or drag to resize

Sensor

Sensor

Contents
Overview

The event trigger in the scene. The sensor allows you to select scene objects by a given volume or ray.

For a good overview of sensors, you can take a look at the 'Sensors.scene' file, which can be found in 'Assets\Samples\Starter Content\Scenes'.

Screenshot999999406.png

The parameter 'Source Data' indicates what type of objects will be determined: scene objects or physical bodies.

In order to see which objects the sensor has selected, you need to enable the 'Display Objects' parameter.

Scripting

Use Objects property to get current list of the affected objects.

Use ObjectEnter and ObjectLeave to get updates of the affect objects, or override OnObjectEnter and OnObjectLeave methods in a derived class.

To refine the filtering, you can create a handler for the FilterObjectEvent event, or override the OnFilterObject method in a derived class.

Properties
Name Description
Source Data What kind of data is used as a source of events.
Shape The shape of the trigger.
Ray Target The target by which the sensor ray will trigger.
Target The end point of the sensor in volume mode.
Mode The recognition mode of the sensor.
Filter By Type The type of objects that sensor will recognize.
Physics Filter Group The group of physical objects that sensor will recognize.
Physics Filter Mask The mask of physical objects that sensor will recognize.
Ignore Sensors Whether the sensor is ignoring other sensors.
When Update The update case mode of the sensor.
Display Color The display color of the sensor.
Display Objects Whether to draw gizmos on the objects recognized by the sensor.
Display Objects Color The color of the recognized object gizmos.
Objects List of objects recognized by the sensor.
See also
OccluderDestroying Sensor