Path planning is critical to the effective operation of unmanned aerial vehicles (UAVs) in complex environments. It is crucial to quickly determine the best path for UAV navigation. In this paper, a novel approach for unmanned aerial vehicle (UAV) path planning is presented by combining the robust artificial bee colony (ABC) algorithm with the flexible rapidly exploring random tree star (RRT*) algorithm. The main objective of this approach is to ensure effective obstacle avoidance. The proposed hybrid algorithm, ABC-RRT*, is compared with several current approaches, namely Improved ABC (IABC), ABC, Particle Swarm Optimization (PSO), ABC-PSO and RRT. ABC-RRT* combines the exploration capabilities of ABC with the route optimization capabilities of RRT* to efficiently determine the best trajectories for UAVs by balancing exploration and exploitation. ABC integration increases the effectiveness of exploration, while RRT* excels at identifying shorter paths and adapting to different conditions. ABC-RRT* has been shown to outperform other methods in terms of path length and flexibility when traversing complicated terrain with many obstacles. This was proven by extensive simulations in various situations. The results demonstrate the effectiveness, fast convergence and robustness of ABC-RRT* and make it a viable solution for obstacle avoidance of UAVs in practice. The fusion of ABC and RRT* for obstacle avoidance shows great potential for UAV route planning and offers remarkable advantages compared to conventional approaches.