Note: You’ll also need to adjust how your projectile is fired, because by default that is also set to follow Pawn rotation. Since we’ve disabled rotating whole Pawn up and down, projectile will only fire straight forward on x plane. To fix this, adjust following in Spawn Projectile section of MyCharacter Blueprint:
We’re just replacing Get Control Rotation node with a Get World Rotation of Mesh1P component. Play with settings for Gun Offset vector node if you want to make shots more accurate.
Hope all that helps!