Camera Forward Vector not matching screen center

I’m currently trying to get the third person aiming working but I have a strange issue. I want to fire a line trace from the camera to wherever the camera is actually aiming to. Then make a line trace from the weapon end to where the camera line trace hit. One would think this would lead to a line trace from the end to the center of the screen but oddly it’s offset to the left.

The Camera boom is offset to the right by 75 and up by 75.

BP Code used to make the line traces:

I have also changed the Get Forward Vector node to a Get Socket Rotation > Get Forward Vector but this results in the same thing.

Any ideas?

You did not add forward to world.

1 Like

Bewcause this is 3rd person setup. You shoot from weapons barrel/muzzle not from camera.

So to properly aim and still shoot from weapon, not camera:

  • line trace from camera, find location where CAMERA is aiming
  • find look at rotation for weapon and character
  • use that to animate upper half of character with weapon properly, so weapon shoots at exact spot where camera is aiming.

But then you will have problem when character is facing wall close to it. Joys of making very accurate animations. Do not overdo it, you do not want perfect reloading magazines (and handling weapons) simulation as a game, which sadly some indie shooters do instead of fun gameplay.

The rotation is certainly a later change for me to ensure the player fires correctly. I currently want to just get aiming accurate so I can then add more functionality to the gun that relates to my idea.

For now, my issue is related to initial camera line trace where the first line trace from the Follow Camera origin to 15000 x Camera forward vector is aiming to the left of the center of the screen. This is the green dot in the play image.

Like this?

No change:

World Loc + Forward * Dist goes into End Trace. Generic camera trace:


May not be related: but be also mindful of how the reticle is drawn. Widgets, for example, are often placed in screenspace using their upper left corner, a 32x32 widget should be offset by -16,-16 px. Again, this may be irrelevant here and is implementation dependent. Only mentioning it since it was done incorrectly in UE4 templates and kept throwing people ('s aim) off, so to speak.

1 Like

AHHH that makes more sense. The addition makes it relative to the camera’s position. That has fixed the issue. Thanks :slight_smile:

1 Like

Are you planning to allow swapping shoulders while aiming?

Yes. Why?

Because I remembered handling it like so:

Perhaps it’d be suitable. Good luck!

1 Like