How to make an object react when you look at it

Hi everyone!

What I’d like to do is to get stationary text appear above an object when I look at the object. But I need it to appear only when my view is roughly centered on it, as though I have narrow PawnSensing attached to my character that can trigger a volume when they intersect (This is what I originally tried to do, but failed).

Thanks in advance!

You can use raytracing and cast your object there.

Link the trace to the Event tick and get the hit actor and cast it and call your desired function.

Trace works but you can use a dot product between the Characters location and the other Actors.

Heres a good video on the topic :)