I will try to be specific here. What I currently want is a way to check if the player stands on a box trigger and aims at / looks at an object. I have a book that is placed on a table. When the player is near it and looks at it and presses the right mouse button, the event should print a string and destroy itself, or set a value. That’s the idea. An event should occur.
If you’re using the first person view, you could get a line trace from the camera to a few hundreds or thousand units in front of you as per your need. If the trace hits anything on the path, you can get the hit result and check if it’s your book actor. You could call this functionality only when your character is within the trigger you mentioned. Here’s a screenshot to help you:
Yes, in fact you can use the same noes that are shown above. Basically what it’s doing is tracing out a line from your camera to a certain distance in the view direction. The first object that gets hit by the trace is then obtained as the hit actor in the break hit result node. You can then cast that actor into whatever type of class you want.