I have a 3D game looking from top to bottom where I move the mouse to aim at targets.
I have a simple box (the player) with a sphere on its middle-front (that is the pistol) and a cylinder on its right (that is the machine gun).
When I use the pistol I can make the player look at the target in a way it can send the bullets in the correct direction and it will hit the target position... that's okay.
The problem is when I send the bullets from the cylinder. It will not hit the target because it is attached to the right side of the cube. The bullets will come out of the cylinder straight forward and will pass near the target position. How can I rotate the player in a way that the cylinder will be pointing exactly to the target?