Download

Issue: Show Text When Looking Directly At An Actor.

For the past few days, I’ve been tinkering around in UE4, watching tutorials and searching online for different techniques. A lot of it is pretty straight forward, but as I’m sure everyone knows, some things can be pretty **** confusing at first.

So, Here I have a light that I want to turn on and off only when I look directly at a light switch. It’s the “Look Directly At” part that I’m having trouble with. I have linked a blueprint below, but here’s a video showing exactly whats happening: https://youtu.be/G_P-lI-LeA4

Anyway, any help would be much appreciated.

Have you tried using the location and forward vector of your camera instead of the player character? You can use GetPlayerCameraManager node to access the camera.

you check that lines trace with “Draw Debug” on ?

Forward vector of player character is not camera forward vector. To trace where you look you need CAMERA forward vector, and you need to trace from camera location not character location.

And turn ot debug drawing in that line trace, it will help to see where that red line really goes.