Using Traces for Weapon Bullets

And here’s an example of the trace in action with debug drawing. The only reason the trace line in the first image is slightly off-center is because I have a camera recoil attached to my shot firing; by default you essentially cannot see the trace, since it goes straight out from the camera. It’s only from another angle that you can see how the trace is being drawn, from where the center of the camera is in 3D space outward in a straight line to what the reticle is over. It’s this trace that determines what the bullet projectile is launched at (or the end of your second trace).