AddForce not influenced by rotation

Hey folks, I’ve been scouring all kinds of related questions and none of them have had my answer.

I’m currently trying to drive a cube toward the local Z-axis while turning. The code has no problem pushing you in the Z-axis once both fingers are pressed onto the screen, but when I lift one the cube turns, but the force does not follow. It continues to head in the direction it initially intended on. I’m thinking it may have something to do with my if-statements? I’ve been working on this all day to no avail.

The default values may need changing.

using UnityEngine;
using System.Collections;

public class ShipController : MonoBehaviour {
    public float speed = 6.0F;
    public float gravity = 20.0F;
	public float handling = 50.0F;
	public GameObject Ship;
	float regionWidth = Screen.width / 2;
    void Update() {
		if (Input.touchCount == 1 & Input.mousePosition.x < regionWidth) {
			Ship.rigidbody.transform.Rotate(Vector3.up * -handling);
		}
		else if (Input.touchCount == 1 & Input.mousePosition.x < regionWidth * 2) { 	
			Ship.rigidbody.transform.Rotate(Vector3.up * handling);
		}
        else if (Input.touchCount == 2) 
			Ship.rigidbody.AddForce(transform.forward * speed);
        
    }
}

I wanted to also mention that my cube has gravity turned off, and its rotation is frozen for X,Y, and Z.

Yes, the ifs are causing your problem: force is being applied only when both fingers are on the screen, thus lifting one finger will rotate the object without applying any force. You could change a little the logic, and also improve a little the performance by caching values in local variables:

void Update(){
  int q = Input.touchCount; // cache touchCount in q
  if (q == 1){ // if one finger only...
    float x = Input.mousePosition.x; // cache mouse X in x
    if (x < regionWidth) { // rotate left?
      Ship.transform.Rotate(Vector3.up * -handling * Time.deltaTime);
    }
    else if (x < regionWidth * 2){ // rotate right?
      Ship.transform.Rotate(Vector3.up * handling * Time.deltaTime);
    }
  }
  if (q >= 1){ // if any touch, move the ship forward
    Ship.rigidbody.AddForce(transform.forward * speed);
  }
}