I would like to hide the widget attached to the enemy until in view that is set to screen in the user interface

I would like to hide the widget attached to the enemy until in view that is set to screen in the user interface. Is this possible in 4.23?

Should be possible in any version. Use a line trace to check for blocking hits. Have the line trace check whichever object types you want. Use the blocking hit result in a branch to turn on or off the widget based on true or false outcome.