I’m terrible at math and struggling with getting this right. I need to distribute projectiles evenly during actor spawn (using object pooling) on a 45 degree angle. Number of projectiles may increase/decrease starting from 1. Does anyone know the math for this?
Currently I’ve done (e.g. say there’s 3 projectiles): ( 45 / 2 ) / 3
It’s split in half as this is the top down 3rd person template and not 2D template so working with 2 planes. Then on spawn I subtract or add the offset to the current actor rotation based off the projectile index being odd or even. So I do the following.
Odd: OFFSET * INDEX * -1
Even: OFFSET * INDEX
I then add that to actor z rotation and set that as the spawn z rotation. This, kinda, works but seams off by a few degrees. I’m sure the math is wrong, but having a hard time with it.