An air ambulance was called, and two people were taken to hospital after a collision between a car and a pedestrian.