Line Trace sometimes won't hit on mesh

As you can see in the image, certain line trace call randomly ignore the StaticMesh…
I have clicked ‘Build All Levels’ before test…

image

Can you show the trace blueprint?

This is my blueprint. Aiming location is actor location + 1000000.0 * normalized_direction,

Where are you setting AimingLocation? If it is set right before the trace it should work as expected.

How are you getting the direction?

I believe it is set to a appropriate location, because the debug lines are drawed as expected.

I got this image by slightly moving mouse around, and press “fire” button. The paremeters of all LineTrace calls are produced by the same function. But LineTrace don’t report some hit randomly.

Thanks for all

thanks for your advice. I guess I should test the functionality of LineTrace in a simpler blueprint first.

All I can tell from the image is that one trace is shorter. a length of 1 million should be visible in the top left corner of your image. So my guess is there is a mistake in your math.

Can’t be of much help if you don’t share everything involving the trace.

2 Likes

Great!I have found there is some mistake when I am calculating the aiming location.

I didn’t share my blueprint because I am programming using some closed-source thirdparty script language. Sorry for that.

I am a freshhand and I didn’t realize it before. This feature is so great for debugging similar problems.

1 Like