I’m trying to create a shooter and I wan’t the weapon damage to be reduced based on how far you were from your target.
At first I tought that if I break the line trace and get the trace end i would get it, but it was returning X = 0 , Y = 0 , Z = 0.
Then i tried using every single output location from the break hit result but i always get X = 0 , Y = 0 , Z = 0.
What’s going on?
I’m setting the line trace like the epic games tutorial, but here’s a screenshot anyway
PS: This node is ment to spawn the projectile at a wall or something like that if it missed a pawn, but the settup for the pawn is “exactly” the same(i use a line trace for objects instead).
PS²: The line traces go out from the camera.
PS³: I’m doing tests with this node because it’s easier to make tests to get the distance on things that are not pawn, but i’m pretty sure it won’t change a bit, or am i wrong?
Are you sure that the trace hits something? If the Out Hit Location always returns (0,0,0) I doubt it does. Please make sure it does. Normally you want a branch after the LineTrace where the Out Hit Blocking Hit is plugged into the condition to make sure the logic is only executed if the trace hits something. Btw are you sure you want to plug all pawns into the ActorsToIgnore input? These are most likely the ones you want to check with your trace.
Ok, i’m a ******. When I changed the shoot BP to add this functionality I added a branch before the line trace and it was never being reached. Fixed it, thanks.