Checking if player is looking in a specific direction?

I am trying to make a horror game, and am trying to make a jumpscare class. It relies on the player facing a certain direction and triggering an event. I came up with a solution that checks the player rotation and if they’re in the trigger box (Not yet implemented). I was wondering if there was an easier way or a more efficient solution as I have noticed in a lot of horror games, that a “scary” event only happens when the player faces a certain direction, or looking at a specific object.

You would probably be best to use player forward vector and the world position of whatever you want them to look at and get the “DOT” product of the 2 vectors will give you an angle in degrees or radians, and then you can compare this to whatever the player’s field of vision would be to tell if the player can “see” the trigger event.