Multiple drones flying in formation in the QGC

Hello everyone!
I want to implement a multi-drone formation flight in QGC, I write my own code to send the position of each drone to each drone through centralised control in the form of ROS topics, and visualise the simulation in QGC, but I’m running into a problem, as you can see in the first picture, my drones are not in the formation that I sent them to, but rather the formation of their initial position in the second picture. After exploring, I found that all the drones will follow the waypoints of the drone I selected, whichever drone I selected. How can I fix this? Would be appreciated!