When your trace hits the interactive object, you tell it ‘hey i’m looking at you’, with an interface call.
The interactive object then does two things
-
Start a timer ( this is how often we check we are being looked at )
-
Displays the widget ( saying, ‘open door’, or whatever ).
Because the player is line tracing to the door ( in this case ) every frame, the door is constantly getting the BPI call. Every time we get the call, we restart the timer from zero.
Eventually, the player looks away and we no longer get the interface message. But the player can’t say ‘I’m not looking at you anymore’, that’s what you’ve realized.
But… it’s ok because now the timer reaches 2 seconds, or whatever, and we turn off the widget.
Like that. Make sense now?
( you can also do it with a retriggerable delay ).