Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Flight Instructor; Flight Crew Flight Engineer; Flight Crew Multiengine
Flight Crew Last 90 Days 50; Flight Crew Total 28000; Flight Crew Type 500
Communication Breakdown; Confusion; Situational Awareness; Distraction
Conflict NMAC; Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Flight Crew Took Evasive Action
Human Factors
At takeoff clearance; given turn left 040; then on roll given runway heading 127 as previous traffic was turned northeast. Climbing off airport boundary given turn left 060. AP (Autopilot) on so commanded turn to 060. Then AP chimes off so I re-engage. I missed resetting heading bug so AP continued turning left thru assigned 060 before I recognized error. Immediately turned off AP and hand flew back to 060. Departure called and inquired heading as I re-established heading. At this moment got a RA (Resolution Advisory) to climb 2000+ to solve conflict. I was already doing near this amount of rate of climb. My estimate was I passed over traffic 300 ft. At the moment did not get a good recollection of the actual altitude.I got behind airplane with heading changes; AP failing off at inopportune time; and slow recognition response. I have not flown this aircraft in 30 days and it showed. Rest of the day went well. Called SAT TRACON upon arrival at destination and was told nothing came up post event. No excuses; I just was behind the departure and airplane at this moment.
BE-300 Captain reported near mid-air collision after takeoff.