I was wondering if there is an algorithm I can steal to create segment concentric rings like those in the pasted image from Starcastle?
I’m envisioning a GameObject with a collection of children for the segments. The parent GameObject will rotate so of course the “ring” will rotate around it.
I’d like an algorithm that would calculate the size, position and rotation of the segments based on the diameter and resolution (number of segments) for the “ring”.
It is doubtful there is someone out there with a ready made script just for this issue. If you are able to break each straight segment, it seems like you just need something that first determines how big and then how many sides. Depending on the # of sides it creates an adjacent line at a certain angle. Aka, if octogonal, start first line at 0 degrees, then spawn a second one 45 degrees from that, and so on. Obviously, im simplifying a lot here but i think that is close to the route you want to go.
Check out this YT page with a bunch of math for game dev stuff, a video in there may be able to help:
It’s a solid game mechanic… I’ve seen it in other games (SuperGoodPixel used it in Major Rocks) and I have actually used it a few times in a few of my games.
I used it on the level boss enemies in 2015 in my Tank Dynamaze2D game: