How do I shoot where the camera is pointing ?

Important side note for line tracing and third person firing mechanisms is you will require TWO line traces for third person perspectives. You can convert screen space on a forward vector to your desired distance to determine a world location to get perfectly centered line traces forward from your reticle/camera and another from the barrel of your weapon or wherever to the world location of the first line trace.

The result would be a starting line trace to where your looking from the camera view and a final line trace from a reference point location on your weapon to that first end point. You can use a small sphere component and place it in front of the weapon to get that actor location and set it hidden in game to get a persistent actor location reference without the rendering overhead.

Otherwise it’ll never line up, perform or look right. FPS is easy… one line from the camera forward x distance. third person requires a little finesse. This same setup also works in “ADS” or first person perspective, but it has its trade offs that will become apparent when shooting at things very close or when a tree or foliage or whatever is blocking the line trace channel.

This can be mostly fixed by moving your starting location of your first line trace forward to about where you characters muzzle is depending on how far away your camera is from the character.