so im trying to make a learning project in a similar vein to star fox, on rails spaceship shooter etc. ive got it so my ship flys forward but when i press left or right i want it to rotate slightly on the z-axis before moving. ive found 2 outcomes to my code so far. 1.) a single press rotates all the way to 180 degrees. or 2.) it only rotates 2 degrees the wont rotate any more.

this is the code im currently using :

```
using UnityEngine;
using System.Collections;
public class playerController : MonoBehaviour {
//initialize the members
Vector3 upVector=new Vector3(0,1,0);
Vector3 forwardVector=new Vector3(0,0,1);
public Transform player;
Quaternion rotation;
public int speed=5;
// Use this for initialization
void Start ()
{
rotation=player.rotation;
rotation.x+=89;
}
// Update is called once per frame
void Update ()
{
float angle_z=0;
float angle_x=0;
float max_z=340;
float min_z=20;
max_z=Mathf.Deg2Rad;
min_z=Mathf.Deg2Rad;
if(Input.GetAxisRaw("Horizontal")>0)
{
if(player.rotation.z<max_z || player.rotation.z==0)
{
angle_z++;
angle_z*=-(3.14f/180);
}
}
else
{
if(Input.GetAxisRaw("Horizontal")<0)
{
if(angle_z>min_z)
{
angle_z=1;
angle_z=Mathf.Deg2Rad;
angle_z*=-1;
}
}
else
{
angle_z=0;
}
}
player.rotation=new Quaternion(player.rotation.x,player.rotation.y,player.rotation.z + angle_z , player.rotation.w);
//move forward based on the rotation axis
rotation=player.rotation;
var absoluteDirection = rotation * Vector3.forward;
transform.position += (absoluteDirection * Time.deltaTime)*speed;
}
}
```

and the transform player is the ship itself as i was getting errors when i tried to use this.transform. please help.