...
A Trigger Collider does not have to be on the same GameObject as the ProximitySensor.
...
Where to find
The Proximity Sensor can be found under Standard Components >Proximity Sensor > Add Physical component.
...
The images below show the complete feature layout of the Proximity Sensor component.
...
Live Data |
|
State | Shows whether the sensor is currently active |
Output Signal | Low when no object is detected. High when at least one object is detected. |
Detected Objects (n) | The number of objects detected within all the Triggers |
Properties |
|
On Signal High() | Actions executed when Output Signal is set to high |
On Signal Low() | Actions executed when Output Signal is set to low |
Triggers (n) | The detection field |
for the Proximity Sensor |
Generate Rigidbodies | When checked creates Rigidbodies on the trigger objects when you enter play mode. |
Control Panel |
|
Generate Control Panel for SlideSwitch | Creates a Control Panelfor the Proximity Sensor |
...
How to use
Create the Colliders to use be used as the Proximity Sensor’s detection space for the Proximity Sensor and set them to be triggers.
...
2. Add the trigger colliders as Triggers.
...
3. Add an action to the Proximity Sensor.
...
4. Test if the actions are activated in runtime.
...