Shooting a bullet with an empty

Hey guys, I followed this tutorial:

but my bullets keep doing this:

Looks like the empty object is not placed at front of the gun…

its in the middle of the camera, I want it to shoot directly in the center of the screen

Can you upload a file?
All it looks like is you should move the empty over a bit, or take it a little bit further away from the camera. Or you could even put it in the cross hair.

I really only recommend shooting from the center of the screen (rather than the gun muzzle) if you use hitscan (IE cast a ray and the hit is calculated instantaneously, no bullet object is involved)- any time an object that you can see travels, especially in a line straight away from the camera, it will look very wrong if it’s not coming from the correct location.

If you want the bullets to hit in the center of the crosshair what I would do is, in python, cast a ray from the crosshair, and point the gun at the location where the ray hits. That way when you fire the bullets they will travel from the barrel of the gun in a straight line to the location where the crosshair was aiming.