The article presents a method of planning the flight trajectory of a swarm of drones using a modified RRT (Rapidly-exploring Random Tree) algorithm. The version of the RRT algorithm presented in the article is called Multiplatform Spacetime RRT*. The proposed modifications make it possible to determine the flight trajectory of UAVs taking into account time constraints related to the area occupied by each platform. Additionally, the proposed algorithm ensures the avoidance of potential collisions of platforms in the air by using a collision avoidance algorithm used in practice based on geometric methods. Two designed and tested modifications of RRT were presented, based on the basic RRT* and Informed RRT* algorithms. The algorithm used in both tested versions guarantees the determination of the optimal flight path for unmanned platforms in a finite, small number of steps, which solely depends on the number of UAVs involved. This algorithm takes into account the dynamic model of the fixed-wing UAV. The simulation results presented by planning the flight trajectory of a swarm, consisting of three and four UAVs using the Multiplatform Spacetime RRT* algorithm, are significantly better than the algorithms that were compared to achieve these results.