The objective of path planning algorithms is to find the optimal path from a source position to a target position. This paper proposes a real-time path planner for UAVs based on the genetic algorithm. The proposed approach does not identify any specific points outside or between obstacles to solve the problems of the invisible path. In addition, this approach uses no additional steps in the genetic algorithm to handle the problems resulting from generating points inside the obstacles, or the intersection between path segments with obstacles.