I start my line trace using whatever input I want to fire the projectile at the camera (using the camera trace), and get its world location and world rotation. The world location is the “start” of the line trace. I then get the forward vector of the camera’s rotation and multiply it by a float variable called “trace distance”. I then add that to the camera’s world location. This is the “end” of my line trace. When it hits something, I break the out hit, and promote the “impact point” to a variable (called by the same name). Also, to make my life easier, I always place a crosshair at the exact center of the screen before I start. When I finally get to spawning the projectile, I use a “find look at rotation” node. The start is just the world location of the camera (which I usually just get again, instead of making it a variable), and the target is the “impact point” variable. Remember, the impact point is set before the projectile even spawns, as the line trace is basically instantaneous and the variable is set a certain number of ticks before. So the return from the find look at rotation populates the rotation pin on my spawn actor from class (which spawns the projectile). I use the forward vector of the socket location or scene component where I want the projectile to shoot out from. The spawner’s transform requires at least a location vector and a rotation vector. The location (for me) is again the world location of the camera, and the rotation pin is fed by the output of the find look at rotation. I usually turn on the debug trace and set it to “for duration”, so I can visually confirm that my projectiles perfectly intersect with both the crosshair and the little hit markers that appear at the end of the trace when it hits something. Of course, you have to know about collision responses and traces to make this work. This is just a basic description, with the assumption that no gravity is applied to your projectiles. For energy weapons and magic projectiles, this works well for me.
I hope I didn’t accidentally make a mistake in describing this. It’s easier when I’m in front of my computer and looking at it. It also helps to not be around 90 seconds from sleeping when posting advice like this!