Af motor library. (sensor/servo/motor avoiding)

Hey!

I'm trying adjust a code for a 2 motor with a sensor/servo to avoid obstacles.
Well it just crashes into everything xD, so sad, and the motors runs for like 2 sec and then it stops, while the sensor(head) is looking around xD. I want to learn/know, what to change so the motor will keep on running while the sensor is looking around to avoid obstacles.

Did this suddenly just start happening? What did you last change?

Paul

No it did this from the start. I only changed the angle of the sensor/servo..

Anyone?