How to detect if player looks at object?

“Trace” or “Line Trace” i think there something for mouse too, checks if there a actor in specific line and you can get object reference of that actor and do something with it.