void FixedUpdate(){
Vector3 newTargetPosition = target.position; //this is where the truck is
transform.LookAt(newTargetPosition); //turn to face target
transform.Translate(Vector3.forward * Time.deltaTime * forwardspeed); //move forward at forward speed
}
I'm new to this so I'm probably missing something rather obvious. The LookAt() function is meant to rotate the object each frame to track a moving object (called target). However it seems to consider the target.position variable to be the object's initial position every frame. As I have almost identical code in another script that DOES track the position of the same object, I am confused as to what is wrong!