I am running into problems with this block of code frequently setting LineTrace’s Impact Point to 0,0,0. What I’m attempting to do is take where the player clicks, line trace to that spot to check for LoS, and then perform whatever action the player had selected. In this case, summon a lightning bolt that goes from the player to the target location.
The red line is the line drawn in code when the player attempts to cast a spell. The yellow line above is the debug line drawn in Blueprints as the following:
When the red line bugs out like that, it is always aimed at 0,0,0. I’m not sure what is going wrong, though. Any help is greatly appreciated.
I have this same bug, using 4.10 … I really wish they’d fix it. I actually have to make extra blueprints to compensate for when it doesn’t work.
If a hit result’s ImpactPoint is zero it usually means that the line trace failed.
I would check the return value of both GetHitResultUnderCursorByChannel and LineTraceSingle to help figure out what is happening.