Blog / Tutorial
How the Interaction system decides what you're looking at
The first thing an interaction system has to answer is simple to say and easy to get wrong: what is the player looking at? The Rookspire Interaction System answers it with one component on the character, AC_Interactor.
A sphere, not a line
A single line trace from the camera misses thin things and punishes the player for aiming a few pixels off. The interactor sweeps a small sphere instead, starting at the character's eyes and going forward for the reach you set. The first interactable thing it hits becomes the focus.
Starting at the eyes rather than the camera means it works in first and third person, on any pawn, without a camera component.
Twenty times a second
The sweep runs 20 times a second by default, not every frame. That is fast enough for the prompt to feel instant and cheap enough to ignore. Reach, radius and rate are settings on the component.
State is read again every time
Each detection reads the target's state again: its prompt, its verb, whether it is enabled and why not. So a chest that the player unlocks while looking at it changes its prompt at once, with no event to wire up.
Holding is cancelled by looking away
For timed holds, releasing the key or looking at something else cancels the hold, so a player can't start gathering herbs and walk off with the progress still filling.
Everything above is in the Interaction System quick start and manual.