So, in my game I have a number of objects that send messages to the player prompting them to take a closer look. I originally did this by having a large spherical trigger collider around the object that activated when they came close. In playtesting, people wanted that message to appear only when the player is looking at the triggering object.
At first I thought I had to do some complicated 3d math to determine the direction that the character is facing in relation to the object, then I thought of another way to do it. Instead of a big spherical trigger around the object, I instead made a small one, and attached an invisible cone shaped trigger (based on line of sight) to the player. My objects trigger checks OnTriggerEnter, and OnTriggerExit to see if the activating trigger is the line of sight cone, and if so calls the message function.
Unfortunately, this doesn’t seem to be working. When my sight cone intersects the objects cone, the object receives an OnTriggerEnter, but then immediately receives an OnTriggerExit. I’m not sure why I am getting the OnTriggerExit call, as the two triggers are still intersecting. I need it to not send the exit until the player looks away, and the triggers are no longer intersecting. Any ideas what is going on, and how to work around?