How to trigger an event when aiming at an actor

Hello, My name is and I am from Bucharest Romania.
I am trying to create a FPS game, but I have a small problem. I want that when the player aims the rifle to an ally, to display it’s name near the small red cursor from the FPS Example. I know how to get the name of the actor, and everything else, but I don’t know how to detect when the player is aiming at that actor.
I am using Blueprints, and I tried the OnBeginCursorOver node, but it is not working, is there any other way to detect if I am aiming at an object/actor?

This can be done pretty easily with LineTraceByChannel (see here for documentation). Use the trace with your pawn’s location being the start location and whatever range you want for an end location in the direction your pawn in facing (example of this exact type of trace is in the documentation). Cast the “Hit Actor” return on the trace hit to the pawn class you expect to hit and if it returns true, then you know that you’re aiming at what you expect and can do whatever logic you need to with the target character.

Thank you sir, I appreciate your help, and thank you for.your time !