Raycast Interactor
NAMESPACEMyDreamGameStudio.InteractAnything
MENU PATHInteraction System > Interactors > Raycast Interactor
COMPATIBILITYUnity 6.0+
DOC VERSION
Interacts with whatever the configured camera is looking directly at. This component casts a physics ray forward from the center of the camera each frame. It is the standard solution for first-person (FPS) or third-person (TPS) crosshair targeting systems.
Editor Interface
Configuration
Target Resolution Pipeline
The RaycastInteractor uses a robust resolution hierarchy to ensure complex prefabs register correctly while keeping continuous mechanics smooth.
- Direct Component Check: It first checks if the hit
Colliderhas anInteractableattached directly to it. - Root Fallback: If not, it checks
GetComponentInParent<Interactable>(). This allows you to attach multiple specific colliders (like a door handle) to an object while keeping the logic on the root. - Continuous Spatial Data: Even if the raycast hits nothing (or hits a non-interactable wall), the system still caches the exact point at the end of the
Ray Distance. This ensures that if the player is currently operating a Drag or Push/Pull mechanic, spatial data continues to flow smoothly even if their crosshair slips off the object.