Problem with my arduino robot

Well I was working on a project that is really common(an obstacle avoiding robot).But I didn’t want to make it with servos or motors but out of an rc car. So I did all of the neccessary stuff ( I removed the screws etc) ,I made the hardware and wrote the code. The problem is this; the car itself has one single motor so I used a L293NE Chip to control it and it didn’t have a servo to turn left and right but another motor that is used as a servo. But when I uploaded the final code i faced some problems.Everything wroked fine but the motor (worked as servo)did not go straight but would go right for some reason.I checked the code step by step, as well as I uploaded the Turning left and right commands and averything worked fine.
Here is the code ;

#include <Servo.h>

Servo myservo;
int echo=10;//echo pin from the HC-SR04
int trig=12;//triger pin from the HC-SR04
int servoPin1=8;/*pin 2 of the L293NE chip that goes to the 
arduinos pin 8*/
int servoPin2=4;/*pin 7 of the L293NE chip that goes to the 
arduinos pin 9 */
int motorPin1=6;/*pin 10 of the L293NE chip that goes to the 
arduinos pin 6*/
int motorPin2=7;/*pin 15 of the L293NE chip that goes to the 
arduinos pin 7*/
int enable=11;/*Pin 9 of the L293NE chip and when it is HIGH 
 the motor runs one or the other way*/
int distanceF;//integer to hold the distance infront of the robot
int distanceL;//integer to hold the distance Left of the robot
int distanceR;//integer to hold the distance Right of the robot
long duration,distance;/*integer to hold the duration of the
 wave and the distance*/

void setup(){
  pinMode(enable,OUTPUT);
  pinMode(servoPin1,OUTPUT);
  pinMode(servoPin2,OUTPUT);
  pinMode(motorPin1,OUTPUT);
  pinMode(motorPin2,OUTPUT);
  analogWrite(enable,153);/*Tells the motor how fast to go from 0
  to 255 */
  pinMode(trig,OUTPUT);
  pinMode(echo,INPUT);
  myservo.attach(9);
}

void loop(){ 
  
  scan();
  delay(100);
  distanceF=distance;
  if (distanceF <=25){
    Stop();
    Backwards();
    delay(1000);
    Stop();
    delay(500);
   myservo.write(0);//turn the head  left
    delay(500);
    scan();
    delay(100);
    distanceL=distance;
    myservo.write(180);//turn the head  right
    delay(500);
    scan();
    delay(100);
    distanceR=distance;
   myservo.write(90);//tells the head to go to center
   delay(100);
    if(distanceL > distanceR){
      Left();
      delay(1000);
      
      Forward();
    }
    else if(distanceR > distanceL);
    Right();
    delay(1000);
   
    Forward();
  }
  else{
    Forward();
  }
}







//--------------------------------------------------------------
//Go Forward
void Forward(){
  digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,LOW);
  digitalWrite(motorPin1,LOW);
  digitalWrite(motorPin2,HIGH);
}
//--------------------------------------------------------------
//Stop moving

void Stop(){
  digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,LOW);
  digitalWrite(motorPin1,LOW);
  digitalWrite(motorPin2,LOW);
}
//--------------------------------------------------------------
//Go Backwards
void Backwards(){
digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,LOW); 
  digitalWrite(motorPin1,HIGH);
  digitalWrite(motorPin2,LOW);
}
//---------------------------------------------------------------
//Go Left
void Left(){
  analogWrite(enable,255);
  digitalWrite(servoPin1,HIGH);
  digitalWrite(servoPin2,LOW);

  digitalWrite(motorPin1,HIGH);
  digitalWrite(motorPin2,LOW);

  delay(1000);
  digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,LOW);
}
//-------------------------------------------------------------
//Go Right

void Right(){
  analogWrite(enable,255);
  digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,HIGH);

  digitalWrite(motorPin1,HIGH);
  digitalWrite(motorPin2,LOW);

  delay(1000);

  digitalWrite(servoPin1,LOW);
  digitalWrite(servoPin2,LOW); 
}
//---------------------------------------------------------------
//Scan to see if there is something on front of the robot
void scan(){
  //Check to see if there is any object 15cm in front of the car
  digitalWrite(trig,LOW);
  delayMicroseconds(2);

  digitalWrite(trig,HIGH);
  delayMicroseconds(10);

  digitalWrite(trig,LOW);
  duration=pulseIn(echo,HIGH);
  distance=duration/58.2;
}

Please help me, I am despert :~.I am thinking pretty serious of suicide!!! XD just kidding!!!

Would like to see a wiring diagram before commenting.

Would like to see a wiring diagram before commenting.

And, some debug output. And, you really should quit overusing global variables.

And, those comments are horrid. Put some white space in them AND put them all on one line!

  analogWrite(enable,153);/*Tells the motor how fast to go from 0
  to 255 */

Bullshit. It does no such thing.

  scan();

This function isn’t scanning. It should return a value, rather than diddle a global variable.

  delay(100);

You measure the distance to an obstacle, and then wait so something might change. Then, you proceed as though nothing had. Why?

Do you open your eyes, look at what’s in front of you, then close your eyes, wait, and then blast off assuming everything is clear? Of course not. Why is your robot doing that?

Your robot is flying blind an awful lot. I hope you don’t mind that it crashes into walls and furniture. I thought you said you were building an obstacle avoiding robot.

  distanceF=distance;
  if (distanceF <=25){

distance is a long. Why are you truncating that to an int?