Projectile doesn't go towards crosshair's direction!

Oh yeah right… lol I even had my aim code open in front of me when I wrote that. What I don’t understand is since this system is obviously identical to ShooterGame’s system, why not just follow what they do? I’d show mine, but the reticle follows the weapon in my design rather than the other way around. Either way it’s a relatively simple trignometry problem and like everything in games (!) can be sovled with triangles.

Your triangle points are the camera, the gun socket, and the end location of the bullet. To calculate the offset for the gun socket to hit the reticle, you need to know the ‘range’ at which the bullet will hit that reticle. That’s why you need the line trace. In your case you also want to make that trace distance infinite, or clamp the length to the maximum range of your weapon. At the moment, if your line trace doesn’t hit then you’re passing an uninitialized variable into ‘InitVelocity’, which you should never do.

Either way, from those three points you can figure out the angle between the line passing from the camera center to the impact location, and another line from the gun socket to the impact location, giving you the angle to fire the projectile at.

There will be cases where this doesn’t work though, such as if the bullet has to pass through geometry to ‘get to’ that reticle location. Most games handle this by having the bullet just come out the center of the screen, but tbh that’s a lame solution. Especially in Multiplayer. Gears of War 1 got away with it though, they just fired particles from the gun instead.