Line tracing in First Person mode.

Brandon236
Sat, 05 Sep 2015 05:50:32 +0000
UI

So I have a first person game. What I’m trying to do is make it so that when the player aims the crosshair (which is locked to the center of the screen) at a certain button and presses the e button then it runs the blueprint for my button. I made a line tracing blueprint which is supposed to check if it’s hitting the object and if it is then it runs. Here’s what I have:

What’s happening is that when I press e, it runs regardless of whether the crosshair is pointing at the button or not. I can be anywhere in the level and press e and the blueprint always runs. So how can I change it so that the blueprint only runs if the crosshair is pointing at the button and the player presses E.

UPDATE: So I have yet another attempt at this line trace which still doesn’t work correctly. Here it is:

This one doesn’t work at all unless you change auto receive input to player 0 but then the blueprint runs everytime I click the mouse and for some reason I keep getting errors that say “Accessed None ‘First Person Camera’ from node LineTraceByChannel in graph ‘EventGraph’ in blueprint button2”. What does that mean. That line trace is in the blueprint for my trigger so it should work but it doesn’t.

13 posts - 1 participant