Line trace not accurate bug?

I have a line trace by channel being used in a game. Initially I had two skeletal meshes under the same parent component on my character. One was for the start location, one for the end. Both were lined up completely on the x and z axis, and only had a different y axis in order to get a further location. The distance was 9999 on y.
I noticed that with a reference (tip of iron sight) the line trace was always sloping down, and missing the target. I double checked everything and indeed there was a large difference between the start and end, in relation to the direction of the gun. I tried also getting a forward vector and it did the same thing, it would just never hit the mark. I ended up raising the z axis on the end socket about 500 units, and it’s much more accurate now.
This could be an issue due to using a separate camera that is placed on the rifle, and switching to that one when zooming. However the line trace (sockets all children of the aiming rifle) were nowhere near straight or where the rifle was aiming.
Bringing the Z axis up was a fix, but I’m not sure why I was having this issue. It may not be a bug, maybe just an awkward and badly implemented system for aiming and shooting on my part, but I don’t see any reason for this to be happening. Any feedback would be useful :slight_smile:

the rear socket might have been rotated or its parent might have a crooked root pivot

I’m not using rotation when calling the line trace, it’s purely from one location, to another. Since they’re both lined up perfectly on an axis, with no difference in Z, it should not matter. The line trace takes the position of the start socket, and draws a line to the position of the end one. I could rotate them all day and their location wouldn’t change.

I was thinking of that for when younused the forward vector, but youre right. start and end loc doesnt care about orientation. so then i wonder if the locations are where you think they are. if you print string on them before performing the trace, do they both show the expected Z coordinate?

I was wondering about that too, when the games running they might be in different positions than expected, I’ll have to check that out in the morning. I’ll just print it after begin play so I don’t get the location changing after the I move the mouse.

I tried it but it was an eyesore. So many numbers… Later I might just get the z location of the sockets and convert it to a float or something, find the difference, then subtract the 5000 or whatever I added previously and hope whatever it prints makes sense.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

Thank you, the form looks very nice and structured, should help with development.