
Built a Pure C++ Interaction System for UE5 — Press, Hold, LOS Detection, and Zero Tick
Hi everyone,
I recently finished an Interaction System built entirely in C++ and wanted to share some implementation details.
The goal was to avoid per-frame polling and keep everything event-driven. Detection uses Sphere Overlap events combined with Line-of-Sight checks, while interaction updates run on a lightweight timer instead of Tick.
Features:
- Press interactions
- Hold interactions with progress callbacks
- Line-of-Sight validation (ignores objects behind walls)
- Priority-based target selection
- CustomDepth outline highlighting
- IInteractable interface for doors, chests, levers, NPCs, or any custom actor
I'm curious how others handle interaction priority when multiple objects overlap.
Do you prefer:
- Distance only?
- Explicit priority values?
- Camera direction weighting?
- Something else?
I'd love to hear different approaches.
Demo video: https://www.youtube.com/watch?v=mgm3DgOgP7k