Pilot reported seeing traffic to follow; became distracted; then followed the wrong aircraft creating a NMAC.
Synopsis
Pilot reported seeing traffic to follow; became distracted; then followed the wrong aircraft creating a NMAC.
Narrative
Contacted Tower right midfield downwind [Runway] XX as instructed previously and informed that I had traffic to follow in sight. Cleared to land number three as traffic to follow (#2) turned right base. By this time I was abeam approach end of runway. Completed pre-landing items and saw traffic on downwind pass opposite direction. Turned base and then final. Upon turning final; Tower queried if I still had traffic to follow in sight. I responded that I saw the aircraft at the 1;000 ft. markers on the runway. Instructed to turn to the right immediately. During turn I saw the traffic I was supposed to follow directly below me. I completed a right 360 as instructed. During this event; I failed to identify the aircraft that was first to land and did not have a complete picture of all the traffic in the pattern. When I shifted my eyes inside the cockpit to adjust throttle; mixture; prop; carb heat; I lost track of traffic to follow. When I looked out again I mistakenly thought the traffic to follow was passing me in the opposite direction. Now that I think back; I realize this would have been too fast for traffic to fly base and final abeam my position. I did not confirm visually by searching for additional traffic or confirming on ADSB. I did not see the traffic while flying base as I was looking forward and watching traffic on short final that I thought was the traffic to follow. When I turned final; the traffic I was supposed to be following was at a lower altitude and likely blocked by my cowl. I am grateful to the Tower Controller for alerting me to the traffic; advising a corrective action; and preventing a mid-air collision.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.