As Sammy was walking, he was looking at a car and heading towards a lamppost.
Is the sentence natural? Could it be improved?
There's nothing wrong with your sentence but one way it could be written is:
"As Sammy walked along he was looking at a car, and heading for a lamppost".
or "...., but heading for a lamppost".
There are a lot of other possible versions.
not a teacher