0
Beantwortet

sensor cannot work normally

xingbutou vor 9 Monaten in General Questions aktualisiert von Support vor 9 Monaten 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

Antwort

Antwort
Beantwortet

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.

GUT, ICH BIN ZUFRIEDEN.
Zufriedenheit von xingbutou vor 9 Monaten

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.

Antwort
Beantwortet

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.