As the title says, I need help with some maths.
Desired result:
The player ship spawns drones with a very short intervals between spawns (say, 0.5s before another drone is created).
The drones would then align themselves around the player ship according to how many drones are currently online.
Let's say 4 drones are currently online so that means 360* / 4 drones = 90 degrees would be the distance in a circle between each drones.
Then eventually the 5th drone goes online so that means it's time to recalculate the distance between drones in a circle. That would be 360* / 5 drones = 72 degrees.
How would I implement this into code? The current code I have only seem to get where the drones would end up in the circle right but the other drones won't adjust themselves to accommodate the new drone.
Bonus: I don't know if this matters but whenever the drones are firing they slow down their orbiting speed and when a new drone is created in the meantime, the drone would overlap with another drone.
Edit 1: I just noticed that the [ (no. of drones) / 360 ] in the equation. I fixed this part of the code by making it [ 360 / (no. of drones) ] but it didn't fix my problem.
Edit 2: re-linked picture. I'm still confused how the forums work when attaching things.
This is what I tried so far. Thanks in advance