Line Trace From Camera Offsets With Distance From Character Spawn

Hello. I’m working on my character blueprint. It’s meant to be a true first person camera character, so it has a full body and I’ve anchored the camera position to the head socket, while keeping rotation world relative, rather than local. The line trace correctly starts from the camera to the end point of the camera’s forward vector * 10000.

The issue I’m having is that the source of that line trace seems to become more and more offset the further the character walks away from the spawn point.

This image ^ shows minimal offset near the spawn point of the character.

This image ^ shows severe offset a bit further from the spawn point (these two tests are separate and much further away from the first)

I’m not entirely sure what’s going on how or to fix it.

For a bit of extra context, I followed this tutorial on YT (more or less), to achieve what I have now: https://www.youtube.com/watch?v=YSuIbcIwp9w I’m not sure how I can share my BP and its dependencies, but if someone can let me know, I’d gladly share.

Otherwise… here’s some screens.
ABP:

Character Components:


Fire Function with Line Trace:

I’ve been butting my head against this one for the better part of a day… y’all my last hope.

1 Like

You have to add the expanded forward vector to the camera location

1 Like

This worked! Thank you!

If I may ask: would you happen to know why this issue occurs and why your suggestion fixed it? I’m still not entirely familiar with all of this, and I wanna make sure I can identify issues like this in the future and compensate for/fix them accordingly.

1 Like

Well, the issue only happened because the maths was a bit off. That’s all :slight_smile: