Distance Sensors for Non perpendicular obstacles

Hi,

I am building a robot based on a UNO but can't find a sensor that works when a robot approaches a wall at an angle. I have tried both Ultrasonic SR04 and IR sensors. If my robot goes straight at a wall or other obstacle it detects it and avoids it, but if it approaches at an angle the it doesn't see it. I assume the light or sound bounces away.

Any ideas?

Thanks

Max

Put the sensor on a servo and scan it back & forth?