Creating a shooting system using objects and not raycasts?

Hello there!
I am trying to create a system where shooting instantiates a bullet and shoots it forward. When the bullet is instantiated, it is positioned at the tip of the weapon, and is shot in the Z+(forward) direction of the weapon. The problem is that depending on how far the bullet travels until hitting a collider, it won't hit exactly where the camera is pointing at because the weapon's forward direction is not the camera's forward direction.
E.g. a laser lens will never focus the beam exactly in one direction, because the light always travels in one direction (which isn't exactly forward), unless it is changed by a lens, which changes directions, but doesn't make it go exactly straight. You end up with a focal point, which is the point, where the light hits exactly where the laser is pointing at. All other points hit off-center. If you don't understand what I mean, look at the attached file. How do I make the gun shoot exactly where the player is looking at? Is there any solution to this?
Thank you!
Alvin

5977103--641753--laser focus.png

If I understand what I think you want, the usual way to do this is to perform a raycast from the camera, and point your weapon towards the point at which your ray hits something, or if it hits nothing, then a point in space some arbitrary far distance away (such as 1000 units).

You can decide whether you want to use this raycast to actually aim the weapon, or if you want to just shoot the projectile in the direction from your weapon tip to the raycast hit point (even though this won't be "straight" from the weapon's point of view. Up to you.