Spawning dynamic objects along the circumference of a circle

Hi, I’ve made a basic algorithm for you. You can define where you want the center, how large you want the radius, and how many to spawn - and it will result in a vector location for each item.

This works by dividing the quantity into a degrees based on a 360 degree circle - because of this you could also adapt it to work in a semi circle by changing to 180 or a quarter circle with 90. Then it multiplies the index by the degrees, so first item is 1 * degrees, second is 2 * degrees, etc. - them it makes a rotator to get the forward vector, which in this case will essentially be the direction it’s pointing it, and multiplying it by the radius moves it along the direction it’s pointing in essentially pushing each location outwards. Then we append the center of circle to position each object.

For previewing purposes I have it connected to a Draw Debug Point, but presumably you would want a Spawn Actor here instead, with the location being fed in.

7 Likes