I am trying to set up a simple line trace but I am not sure how to use the location on a button in my HUD ui as the start point. Basically I have set up my HUD with 2 buttons. One is in the center of the screen and one is directly to the right of it (Position X=500). I would like to be able to hit a button to do a line trace to what is behind the button.
I am able to do the trace from the center point but that is really only because its in the center and not by referencing the button to get its location. I was able to get my trace to her where the side box is but only when pointing directly in front with the following blueprint.
Unfortunately if I turn at all this breaks. This is the left wall (3rd person shooter demo)
I am guessing there is a way to modify the position relative to the direction the character/camera is facing, but I would think if I could use the position on the screen of the HUD element that would be better since it would be less math. I will eventually have more than 2 buttons so the cleaner I can keep this the better, but either way will work if that isn’t possible. I have just started with unreal so I apologize if this is super basic.