Awesome
Detection Sensor For Unity
<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/> <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 :
- Script automatically add visual components for editor.
- Adjust vertical and horizontal ray count.
- Adjust ray positions on scene.
DetectionSensor will also simulate scene :
<br/>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:
- Clone the repo or download the latest release.
- Add the UnityDetectionSensor folder to your Unity project or import the .unitypackage
Contact : sefa@muveso.com