Unity .lookat problems

I am trying to make my car look at and then drive towards an empty. Below is the code I am using.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LookAt : MonoBehaviour
{
public Transform target;
public int number;
void Update()
{

transform.LookAt(target, Vector3.up );
transform.Translate(Vector3.right * Time.deltaTime * 3);

}
}


I have tried setting the world up direction to every single direction and not including it, but not matter what I do the car will not face forward and drive toward the empty. If I set it up or down, the car lays on the passenger or driver side and then slowly goes towards the empty. If I set it to left or right the nose end of the car rotates so that it faces the ground and then the car drives in small circles on either the driver or passenger side. If I set it to forward or backward, the car points up or down and then starts going through the air or under the map towards the empty. If I exclude the world up entirely, the car lays on the driver side, rotates 90 degrees clock wise and then starts going toward the empty like that. 


Any idea on what could be going wrong here? Below is a picture of the car and all of it's component data.

  • Jonathan Gonzalez(jgonzalez) replied

    You could use MoveTowards if you wanted the car to move toward the target while looking at it. Below is how you'd use it. 

    public class Movement : MonoBehaviour {
        public Transform target;
        public float speed;
        void Update() {

            transform.LookAt (target);
            float step = speed * Time.deltaTime;
            transform.position = Vector3.MoveTowards(transform.position, target.position, step);
        }