0
Answered

sensor cannot work normally

xingbutou 8 months ago in General Questions updated by Support 8 months ago 6

I meet a simple but  truly strange problem.In the picture below,I‘m using a sensor to detect if something pass through.However,even I have put the Steuerschrank into MU layer,my sensor cannot detect it.In other occasion,I use the prefab--cans,this sensor could work normally.someone could help me?I have spend nearly one week on this problem. 

Image 958

Answer

Answer
Answered

With a Raycast based Sensor you don't need to use colliders but you need to define the layers where the Raycast is sending to. It is the same Layer as the Sensor is and additional Layers which you can define. 

For a non Raycast (Box Collider) based Sensor - the Sensor should be normally on the layer rvSensor. Please also check the doc information about the collsission matrix for colliders.

GOOD, I'M SATISFIED
Satisfaction mark by xingbutou 8 months ago

Hallo xingbutou, have you attached a collider for this object?

oh my!thanks !I thought only when I turn off the “use raycast” property ,I have to add a collider component.

Answer
Answered

With a Raycast based Sensor you don't need to use colliders but you need to define the layers where the Raycast is sending to. It is the same Layer as the Sensor is and additional Layers which you can define. 

For a non Raycast (Box Collider) based Sensor - the Sensor should be normally on the layer rvSensor. Please also check the doc information about the collsission matrix for colliders.

I just try again,still need a collider.if not,even my sensor and my object are both on the right layer--like the mu layer, my sensor cannot detect this object.  

Image 961

Image 960

A sensor (using raycasts) does not need to have colliders because collision is detected by the raycast the sensor is sending out. But the objects which have to be detected need to have a collider.