How to keep an axis of wing gun while tilting (as in space shooter)

Hi all!

Please, help me with the following, my knowledge is not enough…

I have a player spacecraft with 3 separate guns-gameobjects, each one is firing with projectile velocity.forward as in Space Shooter example. Left and Right guns have some rotation along the Y axis, so, fire scheme is the following:

But when I tilt, my middle gun is OK, but my left and right guns fire too far below or above horizont

I think I should freeze X and Z absolute axises of my guns gameobjects shomehow to prevent this, while keeping rotation along Y allways the same. So, like the guns are always targeting the horizont point in front of them. A little gap because of wing lenth, causing projectile be a little bit below/above the horizont is not very important (but it will be nice if it can be fixed too, may be I’ll have VERY THIN enemy UFOs :)))

What is the best way to do required? Thank you in advance!

Since it is a 2D game, if you do not wish this to happen, simply make the guns separate gameobjects from the model and disable their rotation on all axises.
Otherwise, when instantiating, you could just use world axises for rotation, such as Vector3.up, or take the transform.forward from your model.

Which would make your testing code the following:

 private void Fire()
{
Instantiate(projectile, transform.position, transform.forward);
//Testing many
gameobject tester = Instantiate(projectile, transform.position, Vector3.Up);
tester.transform.renderer.material.color = Color.magenta; //make it distinct.

gameobject tester = Instantiate(projectile, transform.position, Vector3.Forward);
tester.transform.renderer.material.color = Color.blue;

gameobject tester = Instantiate(projectile, transform.position, Vector3.Right);
tester.transform.renderer.material.color = Color.red;
}