Skip to main content

Radius Interactor

NAMESPACEMyDreamGameStudio.InteractAnything
MENU PATHInteraction System > Interactors > Radius Interactor
COMPATIBILITYUnity 6.0+
DOC VERSION

Selects the closest available interactable as the active focus. This component is strictly an interaction driver; it delegates all spatial querying, layer filtering, and line-of-sight checks to a coupled Nearby Interactables Scanner.

Because it cannot function without spatial data, Unity will automatically add a NearbyInteractablesScanner to your GameObject when you attach this component.


Editor Interface​

RADIUS INTERACTORPROXIMITY INPUTPicks the closest candidate evaluated by the coupled Nearby Interactables Scanner and forwards interact on triggers.ATTACHED DETECTION SCANNER✦ Select ScannerCoupled ScannerGameObject (Nearby Interactables Scanner)Detection Radius3.0 mScanning LayersEverything

Configuration​

To keep your Inspector clean, the RadiusInteractor hides duplicate settings. It reads directly from its required scanner component. To modify detection logic, select the coupled scanner.

Coupled Scanner
Read-Only
Automatically binds to the Nearby Interactables Scanner attached to the same GameObject.
Detection Radius
Read-Only
Reflects the current spatial radius configured on the scanner module.

Target Resolution Pipeline​

The architecture strictly separates detection from interaction processing:

  1. Detection Phase: The NearbyInteractablesScanner executes an overlap sphere, filters out invalid layers, checks optional line-of-sight constraints, and sorts valid targets by distance.
  2. Focus Phase: The RadiusInteractor simply asks the scanner for its Closest target each frame.
  3. Execution Phase: When the player presses the interact key, this interactor fires the interaction events on that isolated target.

By separating these concerns, you can safely use the exact same NearbyInteractablesScanner to drive a "Nearby Items" UI compass without forcing the player to actually focus on them.