Path planning is one of the most crucial aspects of implementing unmanned aerial vehicle (UAV) missions. Therefore, it is essential to figure out the optimal path from the starting point to the target point in different scenarios. In this paper, we propose employing a hybrid algorithm, named FPA-GA, generated by combining the flower pollination algorithm (FPA) and genetic algorithm (GA), to find an optimum path in a real modern building's environment. In addition, a cubic polynomial algorithm via two points was proposed to make the route adequate and smooth. Because the GA has a good capability for exploring the search space, it is employed for exploration while the FPA and GA are employed to increase the exploitation capability in the proposed algorithm. Five different scenarios are utilized to evaluate FPA-GA's ability to find the optimal path in a variety of situations, and then the proposed algorithm's performance is compared with that of seven other algorithms: GA, FPA, bat algorithm (BA), particle swarm optimization (PSO), whale optimization algorithm (WOA), improved whale optimization algorithm (IWOA), and IWOA-PSO. The best path, the mean path length, the standard derivation, and the worst path length are the four parameters used to compress data. In all scenarios, the results demonstrate that FPA-GA is capable of locating the shortest and most collision-free paths, and the hybrid algorithm FPA-GA is always superior to other algorithms. The proposed algorithm provided the mean path length enhancement in all scenarios, where the maximum enhancement equals (33.6%), (23.1%), (55.5%), (29.8%), (50.5%), (53.9%), and (26.4%) compared with GA, FPA, BA, PSO, WOA, IWOA, and IWOA-PSO, respectively. On the other hand, the proposed algorithm is guaranteed to find the best path in all scenarios, where the standard deviation of FPA-GA is always less than that of other algorithms.