Rotation Problem ( X , Y , Z )

I’m doing a 2d platform game, the z axis represents the depth in this game, but I don’t need z because as I said the game is 2d. I wanted the character to fire bullets in the game, so I used Quanternion.identity in the instentiate method. The bullets form in the barrel and then move in the z direction. So I easily turned the barrel 90 degrees in the Y axis. But when I turned it 90 degrees, the barrel did not rotate, so the bullets are moving deep when they should move forward, I want the bullets to move on the x-axis.

You should try locking the z axis in the inspector. It’s under the rigidbody if you have one.

EDIT: It’s under constraints. If this doesn’t work then idk what to say, I’m kinda new here.