Radius Interactor
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
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.
Target Resolution Pipeline
The architecture strictly separates detection from interaction processing:
- Detection Phase: The
NearbyInteractablesScannerexecutes an overlap sphere, filters out invalid layers, checks optional line-of-sight constraints, and sorts valid targets by distance. - Focus Phase: The
RadiusInteractorsimply asks the scanner for itsClosesttarget each frame. - 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.