Help with movement

Hi, I keep having a problem and after a lot of looking and checking my code I cannot solve it, so I am looking for some help! My game is a 2d game using 3d models with a top down view. I am trying to move a 3d model spaceship back and forth and let it rotate to the left when i move left, and to the right when I move right. That part seems to be working, but I feel that my problem lies in there somewhere. If I move too much, my spaceship starts to fall down (this is imperceptible in game view, except that the bullets that it fires go below my enemies and do not hit them).

here is my code

public class ShipMove : MonoBehaviour {
	public float speed = 3.0f;
	public GameObject bullets;
	public float spacing;
	float shipdir;
	float timer = 0.2f;
	Quaternion shiprot;
	
	
	
	void Update () {
	float translation = Input.GetAxis("Horizontal") * speed;
	transform.Translate(translation,0,0);
	
	if((translation - shipdir) > 0){
			shiprot = Quaternion.Euler(0,0,-25);
		//	transform.rotate (0,0,25);			
		}
	
	if((translation - shipdir) < 0){
			shiprot = Quaternion.Euler(0,0,25);
		//	transform.Rotate(0,0,-25);
		}
		
	if((translation - shipdir) == 0){
			shiprot = Quaternion.Euler(0,0,0);
		//	transform.Rotate(0,0,0);
		}
	transform.rotation = shiprot;	
	Vector3 pos = transform.position;
	Quaternion rot = transform.rotation;
	timer -= Time.deltaTime;	
	if(Input.GetButton("Fire2")  timer <= 0.0f){
			Instantiate(bullets, pos, rot);
			timer = spacing;
		}
	shipdir = translation; 	
	}
}

I’m not sure if I’m being clear or specific enough with my description of the problem.

I don’t know why I couldn’t figure it out earlier, but as soon as I posted that I did. Sorry for the needless post.

Could you please edit and/or comment on what wasn’t working so that anybody who finds this thread in the future knows? Thanks.

I’m not really sure what was causing the problem, but to fix it, I just added a constraint on transform.position.y to keep it from moving up and down (towards away from the screen).

I added

Vector3 position = transform.position;
position.y = 0;
transform.position = position;

at the end of the update function