Home

Awesome

Detection Sensor For Unity

Unity License: MIT <br/><br/><a href="https://www.buymeacoffee.com/muveso" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a> <br/> <br/> 4 <br/> <br/> The Detection Sensor provides the basic functionality required for visual object detection. It wraps a sensor and exposes a ray list, to which you can use for raycast. You can instantiate and assign the sensor yourself.

Simple Usage

Create a gameobject and attach DetectionSensor component :

1

DetectionSensor will also simulate scene :

<br/>

7

You can use your custom scripts with DetectionSensor :

[SerializeField] public DetectionSensor detectionSensor;
private DetectionRay[] _sensorRays;

private void Start()
{
    _sensorRays = detectionSensor.Rays;
}

private void FixedUpdate()
{
    for (var i = 0; i < _sensorRays.Length; i++)
    {
        var ray = _sensorRays[i];
        if (Physics.Raycast(ray.Ray))
        {
            Debug.Log("Hit!");
        }
    }
}

Unity Package

You can add the code directly to the project:

  1. Clone the repo or download the latest release.
  2. Add the UnityDetectionSensor folder to your Unity project or import the .unitypackage

Contact : sefa@muveso.com