MOST Detector

MOST Detector is used to detect objects and their current/updated position around certain areas, find the closest, and mark it, also, the system comes with an area debug system, scan, and on-site detection system.

You can use this system for enemy AI to sense other objects, auto-aim systems, following, spectating, and detection

MOST Detector system doesn't require rigidbody, collider, or trigger components to work, and has nothing to do with the object collision component and system. Just add it, and the detector will be ready to go.

debugging drawer enabled, look at the closest enabled, mark the closest enabled.

When there is no detected object, the rotation will be controlled by the moving system, otherwise, the detector system will disable the rotation inside moving system and control the rotation

This game is built using MOST Detector system. Here the Detector detects enemies, adds all detected objects to the list, sorts this list from farthest to closest, marks the closest object, and look toward the closest. The shoot system only spawns bullets and moves them forward (character rotation)
The cannon uses MOST Detector_Continuous calling system (check below) and send the detected list (as vectors) to Projectile Generator system

Features

  • Working with characters and AI enemies and characters

  • A debugging system and Gizomos drawer for the detection area

  • can use layer masks or tags to detect

  • Active only on site (detects only objects that are on site and not hidden behind walls, for example)

  • Record inactive objects as well

  • Option for sorting the detected objects list depending on distance

  • Marker system for the closest object

  • Option for Look at the closest or rotate toward the closest

  • Events system

  • Continuous calling system These events will continuously be called if the detector list is not empty and the delay between each call = Delay Between Calls (if = 0 then Time.deltaTime).

API reference

// Next to each line shows the return and set data Type 

// return all detected and active objects (detected list)
Most_Detector.GetAllDetectedObjects(); return List<GameObject>

// return all detected and inactive objects (inactive list)
Most_Detector.GetAllInactivedObjects(); return List<GameObject>

// return the number of detected and active objects (detected list count)
Most_Detector.GetNumberOfDetectedObjects(); return int

// return all detected and active objects' world positions
Most_Detector.GetAllActiveObjectsPositions(); return List<Vector3>

// return the closet detected and active object
Most_Detector.GetTheClosestObject() return GameObject

//_______________________________________________________________//

// enable or disable "look at the closest" logic
Most_Detector.LookAtTheClosest return or set bool

// set or get the rotation speed
Most_Detector.RotationSpeed return or set float

// enable or disable on-site detector
// All detected and inactive objects will become active if ActiveOnlyOnSite
// become true on runtime
Most_Detector.ActiveOnlyOnSite return or set bool

Last updated